home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1996 February / PC Direct CD-ROM (February 1996).iso / install / install.rul < prev    next >
Encoding:
Text File  |  1995-08-30  |  83.7 KB  |  2,243 lines

  1. // ----------------------------------------------------------------------
  2. // Copyright ⌐ 1995, National Education Training Group, Inc.            -
  3. // All rights reserved.                                                 -
  4. //                                                                      -   
  5. // Skill Builder 4.0  Course Installation                by Jerry Malik -                                                                    
  6. //                                                                      -
  7. //----------------------------------------------------------------------- 
  8.  
  9. #include ".\\declare.rul"
  10. #include "c:\\dialog\\dll\\resource.h"
  11. #include ".\\winsub.h"
  12.  
  13. program //  Must use program keyword to start the statements  
  14.  
  15. //-------------------------------------------------------------------
  16. //          This procedure initializes screen colors                -
  17. //-------------------------------------------------------------------
  18.  
  19. Start:
  20.     szSourcedir = SRCDIR;
  21.     VarSave( SRCTARGETDIR );                      // Saves initial system variables
  22.     
  23.     SetColor( STATUSBAR, RED );
  24.     SetFont( FONT_TITLE, STYLE_NORMAL, "Helv" );
  25.     Enable( BACKGROUND );
  26.        
  27. //--------------------------------------------------------------------
  28. //          This code initializes the windows display                -
  29. //--------------------------------------------------------------------
  30.     
  31.     GetProfString( szMessages, "Titles", "INIT_PARAM", szText );
  32.     SetStatusWindow( 1, szText );
  33.  
  34. //  Enable/Disable various objects.
  35.     Disable( BITMAPFADE );    // No bitmaps will fade into the screen.
  36.     Enable( INDVFILESTATUS ); // Shows all filenames when copied.
  37.     Enable( EXIT );           // Exit Button
  38.     Disable( PAUSE );         // Pause Button
  39.     Disable( STATUS );        // Status , % Complete Bar Window
  40.     Disable( TEXT );          // Info Windows
  41.     Disable( FEEDBACK_FULL);  // Feedback window enabled
  42.  
  43. //  Define variable to point to the Dialog Box DLL
  44.     szMessages = SUPPORTDIR ^ "MESSAGES.INI"; 
  45.  
  46.     ChangeDirList = ListCreate( STRINGLIST );
  47.     
  48. //  Set global variables for directories/files used throughout the installation
  49.  
  50.     szWinSys  = WINDIR ^ "SYSTEM";          // points to WINDOWS\SYSTEM directory
  51.     szWindows = WINDIR;                     // points to WINDOWS directory
  52.     szWinINI  = WINDIR ^ "WIN.INI";         // points to WIN.INI file
  53.     szNETGINI = WINDIR ^ "NETG.INI";        // points to NETG.INI file
  54.     szSourcePath = szSourcedir ^ "install.ini";  // points to INSTALL.INI file
  55.     GetProfString( szMessages, "Titles", "PROGRAM_GROUP_TITLE", szPgrp ); // Gets Program Group title 
  56.  
  57.     Handler( EXIT, Exit_Handler );
  58.  
  59. // Gets specific course information from INSTALL.INI
  60.  
  61.     call GetCourseInfo;
  62.  
  63.  
  64. //  Set up background depending on course version.
  65.  
  66.     if ( szVersion < "4.0" ) then                                       
  67.         szBitmapPath = szSourcedir ^ "NETGLOG8.BMP";
  68.         SetColor( BACKGROUND, BLUE );                                   // Use 3.0 bitmap
  69.         PlaceBitmap( szBitmapPath, 101, 20, 20, UPPER_RIGHT );          
  70.         szTitle = "Skill Builder « Installation";
  71.         SetTitle( szTitle, 18, WHITE );
  72.     else
  73.         szBitmapPath = SUPPORTDIR ^ "NETGLOG8.BMP";                     // Use 4.0 bitmap, compressed into support directory
  74.         PlaceBitmap( szBitmapPath, 1, CENTERED, CENTERED, CENTERED );
  75.         SetColor( BACKGROUND, RGB(255,255,255) );                       // Set background color to white
  76.         GetSystemInfo(VIDEO, nvIconIndex, svWrkDir);                    // Determine the resolution setting for the system
  77.         if ((nvIconIndex = IS_UVGA) | (nvIconIndex = IS_UNKNOWN)) then  // Move the status window so that it doesn't
  78.             PlaceWindow( STATUS, 300, 70, LOWER_RIGHT);                 // cover "Skill Builder" on the bitmap depending
  79.         elseif (nvIconIndex = IS_XVGA) then                             // on the system resolution settings
  80.             PlaceWindow( STATUS, 250, 30, LOWER_RIGHT);
  81.         else
  82.            PlaceWindow( STATUS, CENTERED, CENTERED, CENTERED);
  83.         endif;
  84.         szTitle = szCourse + " Course Installation";                    
  85.         SetTitle( szTitle, 18, BLUE );
  86.     endif;    
  87.  
  88. //  Checks for existence of NETG.INI and if not found, copies generic
  89. //  file for installation.
  90.  
  91.     FindFile( szWindows, "NETG.INI", szText );
  92.     if LAST_RESULT != 0
  93.     then
  94.        TARGETDIR = szWindows;
  95.        CopyFile( "NETG.INI", "NETG.INI" );
  96.     endif;                   
  97.     
  98.    
  99. //-------------------------------------------------------------------------
  100. //  Checks to see if the course has been previously installed.            -
  101. //  If the course path exists notifies the user that the course has been  -
  102. //  previously installed and sets default path to the previous path, the  -
  103. //  previous path of the last course installed or C:\.                    -
  104. //-------------------------------------------------------------------------
  105.     
  106.     GetProfString(szNETGINI, szCourse, "path", szPath );
  107.     szText = szPath ^ "SKILLB";
  108.     szText = szText ^ szCourse;
  109.     if ( ExistsDir( szText ) = EXISTS ) then
  110.       nPresent=1;
  111.       szResultPath = szPath;
  112.       call CoursePresent;
  113.       GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
  114.       if ( szLMPath ="") then
  115.         if (( nMediaType & CD_ROM ) & (szVersion > "4.0")) then
  116.            szLMPath = "C:" ^ "SKILLB";
  117.         else
  118.            szLMPath = szResultPath ^ "SKILLB";
  119.         endif;
  120.       endif;
  121.     else
  122.       nPresent=0;
  123.       GetProfString( szNETGINI, "Course", "Total", szText );
  124.       GetProfString( szNETGINI, "Course", "Name" + szText, szText );
  125.       GetProfString( szNETGINI, szText, "Path", szResultPath );
  126.       GetProfString( szNETGINI, szText, "UserPath", szLMPath );
  127.       if ( ExistsDir (szResultPath) = EXISTS) then
  128.         if !( ExistsDir (szLMPath) = EXISTS) then
  129.           szLMPath = szResultPath ^ "SKILLB";
  130.         endif;
  131.       else 
  132.         szResultPath = "C:";
  133.         szLMPath = "C:\\SKILLB";
  134.       endif;
  135.     endif;
  136.     StrToUpper ( szResultPath, szResultPath );
  137.     StrToUpper ( szLMPath, szLMPath );
  138.  
  139.     
  140.  
  141.     szDialogs = SUPPORTDIR ^ "dialogs.dll";  // Load dialog dll
  142.     UseDLL ("NEINSTL.DLL");
  143.     nCheckSpace=0;
  144.     
  145.     
  146. //  Call user registration dialog box - do not run if course is  running entirely off of CD - SB ver >= 4.0
  147.     if ((nMediaType & SINGLE_LEARNER) | (nMediaType & MULTI_LEARNER)) then
  148.        call GetLicense;
  149.     elseif ((nMediaType & CD_ROM) | (nMediaType & PC_CBT))then  
  150.           szDialog = "DLG_GETREGEX";
  151.           nDialog = DLG_GETREGEX;
  152.           call GetRegistration;
  153.     endif;
  154.  
  155. //  Determine which dialog box to display
  156.     call IdentifyDialog;
  157.  
  158. GetInput:
  159.  
  160.    DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED );
  161.  
  162.     bDone = FALSE;
  163.     while (bDone = FALSE)
  164.  
  165.     nCmdValue = WaitOnDialog (szDialog);
  166.     switch ( nCmdValue )
  167.  
  168.       case DLG_INIT:  
  169.          nHwnd = CmdGetHwndDlg( szDialog );
  170.  
  171.           CtrlSetState( szDialog, IDC_MASTERY_FULL, BUTTON_CHECKED );
  172. //**  disable the continue button
  173. //**  _WinSubEnableControl( nHwnd, IDC_LM_PATH, DISABLE );
  174.         
  175. //**  nResult = _WinSubGetChildWindow(nHwnd, IDC_LM_PATH);
  176. //**  _WinSubShowWindow(nResult, 0);
  177.         
  178.         CtrlSetText( szDialog, IDC_INSTALL_PATH, szResultPath ^ "SKILLB" ^ szCourse + "\\" );
  179.         CtrlSetText( szDialog, IDC_LM_PATH, szLMPath + "\\");
  180.         if ( nMediaType & SV_EXISTS ) then 
  181.  
  182.             // Set default setting for SkillVantage button on.
  183.  
  184.           CtrlSetState( szDialog, IDC_SKILLVANTAGE, BUTTON_CHECKED );
  185.         elseif ( nMediaType & NO_SKILLB_LMGT) | ( nMediaType & LAN ) then 
  186.         else
  187.  
  188.             // Set default setting for SB Learner Mgt button on.
  189.  
  190.           CtrlSetState( szDialog, IDC_SB_LEARNER_MGT, BUTTON_CHECKED );
  191.         endif;
  192.  
  193.  
  194.         if ( nMediaType & CD_ROM ) then
  195.           if (nMediaType & AUTO_PAGE_FWD_OFF ) then
  196.             CtrlSetState( szDialog, IDC_AUTO_PAGE_FORWARD, BUTTON_UNCHECKED );
  197.           else
  198.             CtrlSetState( szDialog, IDC_AUTO_PAGE_FORWARD, BUTTON_CHECKED );
  199.           endif;
  200.         endif;
  201.         call EnoughSpace;
  202.         GetDisk( szResultPath, szDisk );
  203.         GetDiskSpace( szDisk );
  204.         nSpaceAvail = LAST_RESULT;
  205.         nSpaceAvail = nSpaceAvail / 1000000;
  206.         NumToStr (szFile,nSpaceAvail);
  207.         szFile = szFile + "MB";
  208.         szDiagSpAvailText = szDiagSpAvailText + szFile;
  209.         CtrlSetText( szDialog, IDC_SPACE_AVAILABLE, szDiagSpAvailText);                  
  210.         
  211.         NumToStr (szFile,nSpace);
  212.         szFile = szFile + "MB";
  213.         szDiagSpReqText = szDiagSpReqText + szFile;
  214.         CtrlSetText( szDialog, IDC_SPACE_REQUIRED, szDiagSpReqText);
  215.                
  216.       case DLG_ERR:
  217.         GetProfString( szMessages, "Messages", "DIALOG_ERR", szText1);
  218.         MessageBox( szText, SEVERE );
  219.         call ExitInstall;
  220.  
  221.       case IDOK:
  222.  
  223.         if ( szVersion > "3.1" ) then
  224.           CtrlGetState (szDialog, IDC_SKILLVANTAGE );
  225.           if ( LAST_RESULT = BUTTON_CHECKED ) then
  226.             nInstallOptions = SV_MANAGER_SELECT;
  227.           else
  228.             CtrlGetState (szDialog, IDC_SB_LEARNER_MGT );
  229.             if ( LAST_RESULT = BUTTON_CHECKED ) then
  230.               nInstallOptions = SB_LMGT_SELECT;
  231.               CtrlGetText (szDialog, IDC_LM_PATH, szLMPath );
  232.               nOffset = StrLength(szLMPath);
  233.               StrSub(szLMPath, szLMPath, 0, nOffset - 1 );
  234.               StrToUpper (szLMPath, szLMPath);
  235.               
  236.             else
  237.               nInstallOptions = NO_MGT_SELECT;
  238.             endif;
  239.           endif;
  240.           CtrlGetState (szDialog, IDC_TIME_OUT );
  241.           if ( LAST_RESULT = BUTTON_CHECKED ) then
  242.             szTimeOut = "50";   
  243.             nInstallOptions = nInstallOptions | TIME_OUT;
  244.           elseif ( LAST_RESULT = BUTTON_UNCHECKED ) then
  245.             szTimeOut = "0";
  246.           else 
  247.           endif;
  248.           CtrlGetState (szDialog, IDC_AUTO_PAGE_FORWARD );
  249.           if ( LAST_RESULT = BUTTON_CHECKED ) then
  250.             szAutoPage = "1";   
  251.           elseif ( LAST_RESULT = BUTTON_UNCHECKED ) then
  252.             szAutoPage = "0";
  253.           endif;
  254.           CtrlGetState (szDialog, IDC_MASTERY_FULL );
  255.           if ( LAST_RESULT = BUTTON_CHECKED ) then
  256.              nInstallOptions = nInstallOptions | MASTERY_FULL_SELECT;
  257.           endif;
  258.           CtrlGetState (szDialog, IDC_MASTERY_PARTIAL );
  259.           if ( LAST_RESULT = BUTTON_CHECKED ) then
  260.              nInstallOptions = nInstallOptions | MASTERY_PARTIAL_SELECT;
  261.           endif;
  262.           CtrlGetState (szDialog, IDC_MASTERY_NONE );
  263.           if ( LAST_RESULT = BUTTON_CHECKED ) then
  264.              nInstallOptions = nInstallOptions | MASTERY_NONE_SELECT;
  265.           endif;          
  266.         endif;
  267.         szText = "";
  268.         bDone = TRUE;    
  269. //***
  270.         if (( nMediaType & CD_ROM ) & (szVersion > "4.0")) then  // Course is  running off of CD
  271.            ParsePath(szResultPath, szSourcedir, DISK);
  272.            call VerifyLMPath;
  273.         else
  274.     
  275.            bDone2 = TRUE;
  276.            call VerifyTarget;
  277.            if ( bDone ) then
  278.               call CheckIfExists;
  279.            endif;
  280.            if ( bDone ) then
  281.               call EnoughSpace;
  282.            endif;
  283.            if ( bDone) then
  284.               if ( nInstallOptions & SB_LMGT_SELECT ) then
  285.                  call VerifyLMPath;                     
  286.               endif;
  287.           endif;
  288.         endif;
  289.  
  290.       case IDHELP:
  291.         call Help_Handler;
  292.  
  293.       case CHANGE_COURSE_PATH:
  294.         szChangeDir = szResultPath;
  295.         szCoursePath = "SKILLB\\" + szCourse + "\\";
  296.         call ChangeDir;
  297.         if (StrCompare (szText, "NO") != 0) then
  298.            szResultPath = szNewPath;
  299.         endif;
  300.         CtrlSetText( szDialog, IDC_INSTALL_PATH, szResultPath ^ "SKILLB" ^ szCourse  + "\\");
  301. //        call CheckIfExists;
  302.         call EnoughSpace;
  303.         GetDiskSpace( szDisk );
  304.         nSpaceAvail = LAST_RESULT;
  305.         nSpaceAvail = nSpaceAvail / 1000000;
  306.         NumToStr (szFile,nSpaceAvail);
  307.         szFile = szFile + "MB";
  308.         szDiagSpAvailText = szDiagSpAvailText + szFile;
  309.         CtrlSetText( szDialog, IDC_SPACE_AVAILABLE, szDiagSpAvailText);
  310.  
  311.         NumToStr (szFile,nSpace);
  312.         szFile = szFile + "MB";
  313.         szDiagSpReqText = szDiagSpReqText + szFile;
  314.         CtrlSetText( szDialog, IDC_SPACE_REQUIRED, szDiagSpReqText);
  315.  
  316.       case COURSE_CHANGE_LMPATH:
  317.         szChangeDir = szLMPath;
  318.         szCoursePath = "";
  319.         call ChangeDir;
  320.         if (StrCompare (szText, "NO") != 0) then
  321.            szLMPath = szNewPath;
  322.         endif;
  323.         CtrlSetText( szDialog, IDC_LM_PATH, szLMPath + "\\" );
  324.  
  325.       case IDCANCEL:
  326.         call ConfirmCancel;
  327.  
  328.       case DLG_CLOSE:
  329.         call ConfirmCancel;
  330.  
  331.     endswitch;
  332.     endwhile;
  333.     EndDialog (szDialog);
  334.     ReleaseDialog (szDialog);
  335.  
  336. //***
  337.  
  338.  
  339. //***
  340. //  Checks for animation driver and loads it if it doesn't exist.
  341.  
  342.     GetSystemInfo ( CPU, nResult, szText );
  343.     if ( nResult = IS_386 ) then
  344.        goto LoadCourse;
  345.     endif;
  346.  
  347.     if (( nMediaType & CD_ROM ) | ( nMediaType & PC_CBT )) then
  348.        if !( nMediaType & NO_MOVIE )  then
  349.            if ( szVersion > "4.0" ) then                                       
  350.               goto LoadCourse;
  351.            else;
  352.              call CheckAnimationDriver;
  353.            endif;
  354.       endif;
  355.     endif;
  356.  
  357. // ----------------------------------------------------------------------
  358. //  Creates course directory and loads files.
  359. // ----------------------------------------------------------------------
  360.  
  361. LoadCourse:
  362.  
  363. //  Checks to make sure that the course directory can be created.
  364.  
  365.     szCoursePath = szResultPath ^ "SKILLB";
  366.     szCoursePath = szCoursePath ^ szCourse;
  367.     if ( CreateDir ( szCoursePath ) != 0 ) then
  368.       GetProfString( szMessages, "Messages", "CREATE_DIR_ERR", szText);
  369.       MessageBox( szText, WARNING );
  370.       goto GetInput;
  371.     endif;
  372.  
  373. //****
  374.     if ( nMediaType & LAN) then
  375.        if ( szVersion > "4.0" ) then
  376. //          GetDisk( szSourcedir, szDisk );
  377. //          SRCDIR = szDisk ^ "\\";
  378.           SRCDIR = szSourcedir;
  379.           TARGETDIR = szResultPath ^ "SKILLB";
  380.           szSBDbase = "ASBMSG40.DBF";
  381.           if (FileCompare( "szSBDbase",
  382.                           "szSBDbase", 
  383.                           COMPARE_DATE ) != LESS_THAN) then
  384.              if (FileCompare( "szSBDbase",
  385.                             "szSBDbase", 
  386.                             COMPARE_DATE ) != EQUALS) then
  387.                  if (CopyFile( szSBDbase, szSBDbase ) < 0) then
  388.                     GetProfString( szMessages, "Messages", "ICONWARE_DB_UPDATE_ERROR", szText );
  389.                     MessageBox ( szText , WARNING );
  390.                  endif;
  391.               endif;
  392.            endif;
  393.        endif;
  394.     endif;
  395.  
  396.  
  397. //*****
  398. //  If network install, creates a directory to hold the Workstation install files.
  399.  
  400.     GetDisk( szCoursePath, szDisk );
  401.     GetSystemInfo ( DRIVE, nResult, szDisk );
  402.     if ( nResult = IS_REMOTE ) then
  403.       if ( nMediaType & LAN ) then
  404.         if ( CreateDir ( szResultPath ^ "SKILLB\\WS" ) != 0 ) then
  405.            GetProfString( szMessages, "Messages", "CREATE_DIR_ERR", szText);
  406.            MessageBox( szText, WARNING );
  407.            goto GetInput;
  408.         endif;
  409.       endif;
  410.     endif;
  411.  
  412.     GetDisk(szSourcedir, szDisk);
  413.     SRCDIR = szDisk ^ "\\";
  414.  
  415. //  Decompressing/Copying files to target directory
  416. //  Show the % Complete Status Bar
  417.  
  418.     GetProfString( szMessages, "Titles", "INS_MISC_FILES", szText );
  419.     SetStatusWindow( 1, szText );
  420.     StatusUpdate( 1, 8 );
  421.  
  422.     if ( nMediaType &  LAN ) then  // Update Workstation Install files
  423.     
  424.        TARGETDIR = szResultPath ^ "SKILLB\\WS";
  425.        if ( CompressGet( "WS.Z", "", COMP_UPDATE_DATE_NEWER ) <0) then
  426.           szText = "WS.Z";
  427.           call CopyError;
  428.       endif;
  429.     endif;
  430.  
  431.     TARGETDIR = szResultPath ^ "SKILLB";  // Define target directory for decompressing files
  432.  
  433. //  Checks for type of install - floppy or CD and call appropriate subroutine.
  434.  
  435.     GetSystemInfo ( DRIVE, nResult, szDisk );
  436.     if ( nResult = IS_REMOVABLE )
  437.     then
  438.       call LoadDisk;
  439.     else
  440.       call LoadCD;  
  441.     endif;
  442.     
  443.     Disable ( FEEDBACK_FULL );
  444.     Disable ( STATUS );
  445.  
  446.     call UpdateNETGINI;
  447.     call Complete; 
  448.   
  449. //    Displays correct complete install message
  450.     
  451. //    Special message for installing SkillVantage tutorial  
  452.      if (szVersion = "3.2x") then
  453.         if ( nInstallOptions & SV_MANAGER_SELECT ) then
  454.            call CheckSkillVantage;
  455.         endif;
  456.         MessageBox( SKILLV_EXIT, INFORMATION );
  457.         call ExitInstall;
  458.      endif;   
  459.  
  460.      if ( nInstallOptions & SV_MANAGER_SELECT ) then    //  Installation with SkillVantage Manager selected
  461.         call CheckSkillVantage;
  462.         GetProfString( szMessages, "Messages", "COMPLETE-2A", szText);
  463.         GetProfString( szMessages, "Messages", "COMPLETE-2B", szText1);
  464.         szText = szText + "\n\n" + szText1;
  465.         GetProfString( szMessages, "Messages", "COMPLETE-2C", szText1);
  466.         szText = szText + "\n" + szText1;
  467.         GetProfString( szMessages, "Messages", "COMPLETE-2D", szText1);
  468.         szText = szText + "\n\n" + szText1;
  469.         MessageBox( szText, INFORMATION );
  470.      
  471.      else                                               //  Installation without SkillVantage Manager selected
  472.         GetProfString( szMessages, "Messages", "COMPLETE-A", szText);
  473.         GetProfString( szMessages, "Messages", "COMPLETE-B", szText1);
  474.         szText = szText + "\n\n" + szText1;
  475.         GetProfString( szMessages, "Messages", "COMPLETE-C", szText1);
  476.         szText = szText + "\n" + szText1;
  477.         GetProfString( szMessages, "Messages", "COMPLETE-D", szText1);
  478.         szText = szText + "\n" + szText1;
  479.         GetProfString( szMessages, "Messages", "COMPLETE-E", szText1);
  480.         szText = szText + "\n\n" + szText1;
  481.         MessageBox( szText, INFORMATION );
  482.      endif;
  483.  
  484.  
  485.     call ExitInstall;           // Clears list variables and exits from installation
  486.  
  487.  
  488. //-----------------------------------------------------------------------------------------------
  489. //  The following code reads the install.ini file to get the course number, name, and icon tag. -
  490. //-----------------------------------------------------------------------------------------------
  491.  
  492. GetCourseInfo:
  493.     
  494.      
  495.     GetProfString( szSourcePath, "course", "number", szCourse );
  496.     if LAST_RESULT != 0
  497.     then
  498.         goto BadInstallINI;
  499.     endif;
  500.      
  501.     GetProfString( szSourcePath, "course", "name", szCourseName );
  502.     if LAST_RESULT != 0
  503.     then
  504.         goto BadInstallINI;
  505.     endif;
  506.      
  507.     GetProfString( szSourcePath, "course", "courseid", szCourseID );
  508.     if LAST_RESULT != 0
  509.     then
  510.         goto BadInstallINI;
  511.     endif;
  512.     
  513.     GetProfString( szSourcePath, "course", "icon", szIconTag );
  514.     if LAST_RESULT != 0
  515.     then
  516.         goto BadInstallINI;
  517.     endif;
  518.     
  519.     GetProfString( szSourcePath, "course", "iconfile", szIconFile );
  520.     if LAST_RESULT != 0
  521.     then
  522.         goto BadInstallINI;
  523.     endif;
  524.  
  525.     GetProfString( szSourcePath, "install", "network", szNetwork );
  526.     if LAST_RESULT != 0
  527.     then
  528.         goto BadInstallINI;
  529.     endif;
  530.   
  531.     GetProfString( szSourcePath, "install", "type", szText2 );
  532.     if LAST_RESULT != 0
  533.     then
  534.         goto BadInstallINI;
  535.     endif;
  536.  
  537.     StrToUpper( szText2, szText2 );
  538.     if ( szText2 = "CD" ) then 
  539.       nMediaType = CD_ROM;
  540.     elseif
  541.        ( szText2 = "PC/CBT" ) then
  542.       nMediaType = PC_CBT;
  543.     elseif
  544.        ( szText2 = "LAN" ) then
  545.       nMediaType = LAN;
  546.     else  
  547.        goto BadInstallINI;
  548.     endif;
  549.  
  550.     GetProfString( szSourcePath, "install", "lang", szLang );
  551.     if LAST_RESULT != 0
  552.     then
  553.         goto BadInstallINI;
  554.     endif;
  555.  
  556.     GetProfString( szSourcePath, "install", "ver", szVersion );
  557.     if LAST_RESULT != 0
  558.     then
  559.         goto BadInstallINI;
  560.     endif;
  561.  
  562. //  Optional line in INSTALL.INI which turns Student Management off for the course.
  563.  
  564.     GetProfString( szSourcePath, "install", "StudentMgt", szStMgt );
  565.     StrToUpper( szStMgt, szStMgt );
  566.     if ( szStMgt = "NO" ) then 
  567.        nMediaType = nMediaType | NO_SKILLB_LMGT; 
  568.     endif;
  569.  
  570. //  Optional line in INSTALL.INI which indicates that there is no movie for the course.
  571.  
  572.     GetProfString( szSourcePath, "install", "Movie", szText );
  573.     StrToUpper( szText, szText );
  574.     if ( szText = "NO" ) then 
  575.        nMediaType = nMediaType | NO_MOVIE; 
  576.     endif;
  577.  
  578. //  Optional line in INSTALL.INI which indicates that auto page advance defaults to off
  579.  
  580.     GetProfString( szSourcePath, "install", "AutoPageForward", szText );
  581.     StrToUpper( szText, szText );
  582.     if ( szText = "OFF" ) then 
  583.        nMediaType = nMediaType | AUTO_PAGE_FWD_OFF; 
  584.     endif;
  585.  
  586. //  Optional line in INSTALL.INI which indicates that this is a Single Learner product
  587.  
  588.     GetProfString( szSourcePath, "install", "SingleLearner", szText );
  589.     StrToUpper( szText, szText );
  590.     if ( szText = "YES" ) then 
  591.        nMediaType = nMediaType | SINGLE_LEARNER; 
  592.     endif;            
  593.  
  594. //  Optional line in INSTALL.INI which indicates that this is a Multi-Learner product
  595.  
  596.     GetProfString( szSourcePath, "install", "MultiLearner", szText );
  597.     StrToUpper( szText, szText );
  598.     if ( szText = "YES" ) then 
  599.        nMediaType = nMediaType | MULTI_LEARNER; 
  600.     endif;            
  601.     
  602. //  Checking to see if SkillVantage Manager is installed.
  603.  
  604.     FindFile( szWindows, "SKILLV.INI", szText );
  605.     if ( szText = "SKILLV.INI" ) then
  606.        nMediaType = nMediaType | SV_EXISTS;
  607.     endif;
  608.     return;
  609.  
  610. //-----------------------------------------------------------------------
  611. //      Displays dialog box and verification screen for user information.
  612. //-----------------------------------------------------------------------
  613. GetLicense:
  614.  
  615.     GetProfInt(szSourcePath, "Agreements", "Total", nTotalAgreements );
  616.     AgreementList = ListCreate( STRINGLIST );
  617.     
  618.     for nCount = 1 to nTotalAgreements
  619.        NumToStr(szText,nCount);
  620.        GetProfString(szSourcePath, "Agreements", "Name" + szText, szAgreement );
  621.        ListAddString ( AgreementList, szAgreement, AFTER );
  622.     endfor;
  623.  
  624.     szDialog  = "LICENSE_AGREEMENT_INIT";
  625.     nDialog = LICENSE_AGREEMENT_INIT;
  626.     if (DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED ))
  627.     then
  628.         GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
  629.         MessageBox( szText, SEVERE );
  630.         call ExitInstall;
  631.     endif;
  632.     bDone = FALSE;
  633.     while (bDone = FALSE)
  634.  
  635.     nCmdValue = WaitOnDialog (szDialog);
  636.     switch ( nCmdValue )
  637.  
  638.       case DLG_INIT:
  639.           CtrlSetList ( szDialog, LICENSE_AGREEMENT_LIST, AgreementList );
  640.           CtrlSetCurSel ( szDialog, LICENSE_AGREEMENT_LIST, szAgreement );
  641.           CtrlSelectText (szDialog, LICENSE_AGREEMENT_LIST );
  642.  
  643.  
  644.       case DLG_ERR:
  645.         GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
  646.         MessageBox( szText, SEVERE );
  647.         call ExitInstall;
  648.  
  649.       case IDOK:
  650.           szText = "";
  651.           CtrlGetCurSel ( szDialog, LICENSE_AGREEMENT_LIST, szAgreement );
  652.           GetProfString(szSourcePath, szAgreement, "file", szAgreement );
  653.           VarRestore( SRCTARGETDIR );
  654.           bDone = TRUE;
  655.  
  656.       case IDCANCEL:
  657.         call ConfirmCancel;
  658.  
  659.        case DLG_CLOSE:
  660.         call ConfirmCancel;
  661.  
  662.        endswitch;
  663.     endwhile;
  664.  
  665.     EndDialog(  "LICENSE_AGREEMENT_INIT"  );
  666.     ReleaseDialog( "LICENSE_AGREEMENT_INIT" );
  667.   
  668.     szDialog  = "LICENSE_ACCEPT";
  669.     nDialog = LICENSE_ACCEPT;
  670.  
  671. GetRegistration:
  672.  
  673.     if (DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED ))
  674.     then
  675.         GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
  676.         MessageBox( szText, SEVERE );
  677.         call 
  678.         ExitInstall;
  679.     endif;
  680.     bDone = FALSE;
  681.     while (bDone = FALSE)
  682.  
  683.     nCmdValue = WaitOnDialog (szDialog);
  684.     switch ( nCmdValue )
  685.        case DLG_INIT:
  686.             CtrlSetText( szDialog, ID_DLG_GETREGEX_NAME, szName );
  687.             CtrlSetText( szDialog, ID_DLG_GETREGEX_CO, szCompany );
  688.  
  689.             CtrlSelectText( szDialog, ID_DLG_GETREGEX_NAME );
  690.             nHwnd = CmdGetHwndDlg( szDialog );
  691.  
  692.             // disable the continue button
  693.             _WinSubEnableControl( nHwnd, IDOK, DISABLE );
  694.  
  695.             // check if all the fields are not empty if they are
  696.             // not then enable the continue button
  697.  
  698.             if  ( szName != "" ) then
  699.                  if  ( szCompany != "" )  then
  700.                      _WinSubEnableControl( nHwnd, IDOK, ENABLE );
  701.                endif;
  702.             endif;
  703. //--------------------------------------------------------------------------------------------------
  704. //  Display the license agreement for single and multi-learner products
  705. //--------------------------------------------------------------------------------------------------
  706.             
  707.             if ((nMediaType & SINGLE_LEARNER) | (nMediaType & MULTI_LEARNER)) then
  708.                nHwdInstall = GetWindowHandle(HWND_INSTALL);
  709.                WinHelp( nHwdInstall, szSourcedir ^ "lic.hlp", HELP_CONTENTS, 0 );
  710.                hWnd = FindWindow( "MS_WINHELP", "");
  711.                ShowWindow ( hWnd, SW_SHOW );
  712.             endif;
  713.     
  714.  
  715.        case ID_DLG_GETREGEX_NAME:
  716.             nResult = CtrlGetSubCommand( szDialog );
  717.  
  718.             // if name field is NULL then disable the continue
  719.             // button else enable the continue button
  720.  
  721.             if (  nResult = EDITBOX_CHANGE  ) then
  722.                CtrlGetText( szDialog, ID_DLG_GETREGEX_NAME, szName );
  723.                if ( szName = "" ) then
  724.                   _WinSubEnableControl( nHwnd, IDOK, DISABLE );
  725.                else
  726.                    if (szCompany != "" ) then
  727.                        _WinSubEnableControl( nHwnd, IDOK, ENABLE );
  728.                   endif;
  729.                 endif;
  730.             endif;
  731.  
  732.       case ID_DLG_GETREGEX_CO:
  733.             nResult = CtrlGetSubCommand( szDialog );
  734.  
  735.             if (  nResult = EDITBOX_CHANGE  ) then
  736.                CtrlGetText( szDialog, ID_DLG_GETREGEX_CO, szCompany );
  737.                if ( szCompany = "" ) then
  738.                   _WinSubEnableControl( nHwnd, IDOK, DISABLE );
  739.                else
  740.                   if (szName != "" ) then
  741.                        _WinSubEnableControl( nHwnd, IDOK, ENABLE );
  742.                   endif;
  743.                endif;
  744.             endif;
  745.  
  746.       case GET_LICENCE:
  747.           szText = "GetLicense";
  748.           bDone = TRUE;
  749.  
  750.       case DLG_ERR:
  751.           GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
  752.           MessageBox( szText, SEVERE );
  753.           call ExitInstall;
  754.  
  755.       case IDOK:
  756.           szText = "";
  757.           CtrlGetText( szDialog, ID_DLG_GETREGEX_NAME, szName );
  758.           CtrlGetText( szDialog, ID_DLG_GETREGEX_CO, szCompany );
  759.           bDone = TRUE;
  760.  
  761.       case IDCANCEL:
  762.         call ConfirmCancel;
  763.  
  764.       case DLG_CLOSE:
  765.         call ConfirmCancel;
  766.  
  767.        endswitch;
  768.     endwhile;
  769.  
  770.     EndDialog(  szDialog  );
  771.     ReleaseDialog( szDialog );
  772.  
  773.     if ( szText = "GetLicense" ) then
  774.         goto GetLicense;
  775.     endif;
  776.  
  777. ConfirmRegistration:
  778.  
  779.     szDialog  = "DLG_CONFIRMEX";
  780.     nDialog = DLG_CONFIRMEX;
  781.     if (DefineDialog ( szDialog, 0, szDialogs, nDialog, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED ))
  782.     then
  783.         GetProfString( szMessages, "Messages", "DIALOG_ERR", szText);
  784.         MessageBox( szText, SEVERE );
  785.         call ExitInstall;
  786.     endif;
  787.     bDone = FALSE;
  788.     while (bDone = FALSE)
  789.  
  790.     nCmdValue = WaitOnDialog (szDialog);
  791.     switch ( nCmdValue )
  792.        case DLG_INIT:
  793.           CtrlSetText (  szDialog, ID_DLG_CONFIRMEX_NAME, szName  );
  794.           CtrlSetText (  szDialog, ID_DLG_CONFIRMEX_CO, szCompany  );
  795.  
  796.        case IDOK:
  797.           szText = "YES";
  798.           bDone = TRUE;
  799.  
  800.        case IDCANCEL:
  801.           szText = "NO";
  802.           bDone = TRUE;
  803.  
  804.        case DLG_CLOSE:
  805.         call ConfirmCancel;
  806.  
  807.        endswitch;
  808.     endwhile;
  809.  
  810.     EndDialog(  szDialog  );
  811.     ReleaseDialog( szDialog );
  812.  
  813.     if ( szText = "NO" ) then
  814.        if ((nMediaType & SINGLE_LEARNER) | (nMediaType & MULTI_LEARNER)) then
  815.           szDialog  = "LICENSE_ACCEPT";
  816.           nDialog = LICENSE_ACCEPT;
  817.        else
  818.           szDialog = "DLG_GETREGEX";
  819.           nDialog = DLG_GETREGEX;
  820.        endif;
  821.        goto GetRegistration;
  822.     endif;
  823.     return;
  824.  
  825.  
  826. IdentifyDialog:
  827. //------------------------------------------------------------------------
  828. //  Identifies the correct dialog box to display - following is a list
  829. //  of valid dialog boxes:
  830. //                             Single
  831. //  Media    SVINI  SMgt Avail Learner     Dialog Box Name
  832. //   CD       Yes      Yes       No         INSTALL_CD_SV
  833. //   CD       No       Yes       No         INSTALL_CD
  834. //   CD       Yes      Yes       Yes        INSTALL_CD_SV_SL
  835. //   CD       No       Yes       Yes        INSTALL_CD_SL
  836. //   CD       Yes      No        No         INSTALL_CD_SV_N
  837. //   CD       No       No        No         INSTALL_CD_N
  838. //   CBT      Yes      Yes       --         INSTALL_CBT_SV
  839. //   CBT      No       Yes       --         INSTALL_CBT
  840. //   CBT      Yes      No        --         INSTALL_CBT_SV_N
  841. //   CBT      No       No        --         INSTALL_CBT_N
  842. //   LAN      Yes     --         --         INSTALL_CBT_SV_N
  843. //   LAN      No      --         --         INSTALL_CBT_N
  844. //------------------------------------------------------------------------
  845.  
  846. //  Start with CD-ROM  courses
  847.  
  848.     if ( nMediaType & CD_ROM ) then  
  849.  
  850. //  The AutoPageForward option was added in version 3.11 and later - verifies that
  851. //  the course version is 3.11 or later and displays correct dialog box or displays
  852. //  equivalent dialog box without AutoPageForward (PC/CBT dialog box).
  853.  
  854.       if (( szVersion > "3.2" ) | !(StrCompare( szVersion, "3.11" ))) then 
  855.          if ( nMediaType & SV_EXISTS ) then
  856.             if ( nMediaType & NO_SKILLB_LMGT ) then
  857.                szDialog  = "INSTALL_CD_SV_N";
  858.                nDialog   = INSTALL_CD_SV_N;
  859.             elseif ( nMediaType & SINGLE_LEARNER ) then
  860.                szDialog  = "INSTALL_CD_SV_SL";
  861.                nDialog   = INSTALL_CD_SV_SL;
  862.             else
  863.                szDialog  = "INSTALL_CD_SV";
  864.                nDialog   = INSTALL_CD_SV;
  865.             endif;
  866.          elseif ( nMediaType & NO_SKILLB_LMGT ) then
  867.             szDialog  = "INSTALL_CD_N";
  868.             nDialog   = INSTALL_CD_N;
  869.          elseif ( nMediaType & SINGLE_LEARNER ) then
  870.             szDialog  = "INSTALL_CD_SL";
  871.             nDialog   = INSTALL_CD_SL;
  872.          else
  873.                szDialog  = "INSTALL_CD";
  874.                nDialog   = INSTALL_CD;
  875.          endif;
  876.       else
  877.         if ( nMediaType & SV_EXISTS ) then
  878.           if ( nMediaType & NO_SKILLB_LMGT ) then
  879.             szDialog  = "INSTALL_CBT_SV_N";
  880.             nDialog   = INSTALL_CBT_SV_N;
  881.           else
  882.             szDialog  = "INSTALL_CBT_SV";
  883.             nDialog   = INSTALL_CBT_SV;
  884.           endif;
  885.         elseif ( nMediaType & NO_SKILLB_LMGT ) then
  886.           szDialog  = "INSTALL_CBT_N";
  887.           nDialog   = INSTALL_CBT_N;
  888.         else
  889.           szDialog  = "INSTALL_CBT";
  890.           nDialog   = INSTALL_CBT;
  891.         endif;
  892.       endif;
  893.     endif;
  894.  
  895.     if ( nMediaType & PC_CBT ) then
  896.      if ( nMediaType & SV_EXISTS ) then
  897.         if ( nMediaType & NO_SKILLB_LMGT ) then
  898.           szDialog  = "INSTALL_CBT_SV_N";
  899.           nDialog   = INSTALL_CBT_SV_N;
  900.         else
  901.           szDialog  = "INSTALL_CBT_SV";
  902.           nDialog   = INSTALL_CBT_SV;
  903.         endif;
  904.       elseif ( nMediaType & NO_SKILLB_LMGT ) then
  905.         szDialog  = "INSTALL_CBT_N";
  906.         nDialog   = INSTALL_CBT_N;
  907.       else
  908.         szDialog  = "INSTALL_CBT";
  909.         nDialog   = INSTALL_CBT;
  910.       endif;
  911.     endif;
  912.     
  913.     if ( nMediaType & LAN ) then
  914.      if ( nMediaType & SV_EXISTS ) then
  915.         szDialog  = "INSTALL_CBT_SV_N";
  916.         nDialog   = INSTALL_CBT_SV_N;
  917.       else
  918.         szDialog  = "INSTALL_CBT_N";
  919.         nDialog   = INSTALL_CBT_N;
  920.       endif;
  921.     endif;
  922.     
  923. //  Added code to find dialog boxes for 4.0 products with mastery test
  924.  
  925.     if ( szVersion > "4.0" ) then
  926.        if ( nMediaType & SV_EXISTS ) then 
  927.           if ( nMediaType & SINGLE_LEARNER ) then
  928.              szDialog  = "INSTALL_CD_40_SV_SL";
  929.              nDialog   = INSTALL_CD_40_SV_SL;
  930.           else
  931.              szDialog = "INSTALL_CD_SV_40";
  932.              nDialog = INSTALL_CD_SV_40;
  933.          endif;
  934.        else     
  935.           if ( nMediaType & SINGLE_LEARNER ) then
  936.              szDialog  = "INSTALL_CD_40_SL";
  937.              nDialog   = INSTALL_CD_40_SL;
  938.           else
  939.              szDialog = "INSTALL_CD_40";
  940.              nDialog = INSTALL_CD_40;
  941.           endif;
  942.        endif;
  943.  
  944.        if ( nMediaType & LAN ) then 
  945.           if ( nMediaType & SV_EXISTS ) then 
  946.              szDialog = "INSTALL_SV_40";
  947.              nDialog = INSTALL_SV_40;
  948.           else     
  949.              szDialog = "INSTALL_CBT_N_40";
  950.              nDialog = INSTALL_CBT_N_40;
  951.           endif;
  952.        endif;   
  953.     endif;
  954.  
  955.     return;
  956.  
  957.  
  958. //-----------------------------------------------------------------------
  959. //      Verifies target is valid, if course has already been            -
  960. //      installed in the target directory and if the target             -
  961. //      directory contains Learner Management Files                     -
  962. //-----------------------------------------------------------------------
  963.  
  964. VerifyTarget: 
  965.  
  966.     if (bDone) then              // Subroutine called after exiting GetInput dialog box
  967.        szNewPath = szResultPath; // need to assign verified path to szNewPath
  968.     endif;
  969.  
  970.     StrSub(szWork, szNewPath,1,1);
  971.     if (szWork != ":") then
  972.        GetProfString( szMessages, "Messages", "INVALID_PATH", szText);
  973.        MessageBox (szText, WARNING);
  974.        bDone2 = FALSE;
  975.        bDone = FALSE;
  976.        return;
  977.     endif;
  978.  
  979.     StrLength(szNewPath);
  980.     nOffset = LAST_RESULT - 1;
  981.     if (nOffset < 0)    then 
  982.        GetProfString( szMessages, "Messages", "INVALID_PATH", szText);
  983.        MessageBox (szText, WARNING);
  984.        bDone2 = FALSE;
  985.        bDone = FALSE;
  986.        return;
  987.     endif;
  988.     
  989.     StrSub(szWork, szNewPath, nOffset, 1);
  990.     
  991.     StrCompare( szWork, "\\" );
  992.     if LAST_RESULT = 0      // Trim the last backslash off
  993.     then
  994.       StrSub(szNewPath, szNewPath, 0, nOffset);
  995.     endif;
  996.     
  997.  // if invalid disk entered, reprompt
  998.     GetDisk( szNewPath, szDisk );
  999.     if (ExistsDisk( szDisk ) != EXISTS ) then
  1000.        GetProfString( szMessages, "Messages", "INVALID_DRIVE", szText1);
  1001.        szText = szDisk + szText1;
  1002.        MessageBox( szText, WARNING );
  1003.        bDone2 = FALSE;
  1004.        bDone = FALSE;
  1005.        return;
  1006.     endif;
  1007.     
  1008. //    GetDisk( SRCDIR, szText );
  1009. //    if !(StrCompare (szDisk, szText)) then
  1010. //        MessageBox (SAME_DRIVE, INFORMATION);
  1011. //        bDone2 = FALSE;
  1012. //       return;
  1013. //    endif;
  1014.  
  1015.     if (bDone) then             
  1016.        szResultPath = szNewPath;
  1017.     endif;
  1018.  
  1019.     return;
  1020.  
  1021. CheckIfExists:        
  1022.  
  1023. //  Don't allow an installation of a CDROM course over a network or diskette installation    
  1024.     
  1025.     if ( ExistsDir( szResultPath ^ "SKILLB" ^ szCourse ) = EXISTS ) then
  1026.        if (( ExistsDir( szResultPath ^ "SKILLB" ^ szCourse ^ "PICS_ENU" ) = EXISTS ) & ( nMediaType & CD_ROM )) then
  1027.           GetProfString( szMessages, "Messages", "OTHER_MEDIA_1", szText);
  1028.           GetProfString( szMessages, "Messages", "DIFFERENT_PATH", szText1);
  1029.           MessageBox (szText + "\n\n" + szText1, INFORMATION);
  1030.           bDone = FALSE;
  1031.           return;
  1032.        endif;    
  1033.        Enable( STATUS );
  1034.        GetProfString( szMessages, "Titles", "REMOVE_COURSE", szText );
  1035.        SetStatusWindow(7, szText );
  1036.        szText = szResultPath ^ "SKILLB" ^ szCourse;
  1037.        
  1038.        if ( StrCompare( szText, szLMPath ) = 0)  then      // Do not delete directory with Learner Management files          
  1039.           nCheckSpace = 0;                                 // since files are not deleted do not check disk space
  1040.            
  1041.        elseif (DeleteDir (szText, ALLCONTENTS ) < 0) then           //  Could not delete existing course directory
  1042.           GetProfString( szMessages, "Messages", "DELETE_DIR_ERR", szText1);
  1043.           MessageBox (szText1 + szText, SEVERE);
  1044.           goto ExitInstall;
  1045.        
  1046.        else
  1047.           nCheckSpace = 1;                                 //  Successfully deleted existing course directory
  1048.        endif;
  1049.     else                                                   //  Course doesn't exist at szResultPath
  1050.        nCheckSpace = 1;                                    //  A setting of 1 indicates to check disk space
  1051.     endif;
  1052.     bDone = TRUE;
  1053.     Disable( STATUS );
  1054.     return;
  1055.  
  1056. EnoughSpace:
  1057.  
  1058. //  Checks to make sure that there is enough space on the hard drive to install the course.
  1059.  
  1060.  
  1061. //--------------------------------------------------------------------
  1062. //             This procedure calculates disk space for the course   -
  1063. //             and verifies that the destination drive has           -
  1064. //             sufficient space to load the course.                  -  
  1065. //--------------------------------------------------------------------
  1066.     
  1067.     GetDisk( szResultPath, szDisk );
  1068.     GetDiskSpace( szDisk );
  1069.     nSpaceAvail = LAST_RESULT;
  1070.     nSpaceAvail = nSpaceAvail / 1000000;
  1071.     StrSub(szText2, szResultPath, 0, 1);
  1072.     nClusterSize = GetClusterSize( szText2 ); 
  1073.     if ((nClusterSize < 2) | (nClusterSize > 64)) then  // Out of bounds value defaults to 8k
  1074.        nClusterSize = 8;                              
  1075.     endif;
  1076.           
  1077.     NumToStr (szClusterSize, nClusterSize );
  1078.       
  1079.     GetSystemInfo ( DRIVE, nResult, szDisk );
  1080.     if ( nResult = IS_REMOTE ) then
  1081.        GetProfString( szMessages, "Dialogs", "IDC_SPACE_REQ_TITLE_LAN", szDiagSpReqText);   
  1082.        szClusterSize = "8";
  1083.     else     
  1084.        GetProfString( szMessages, "Dialogs", "IDC_SPACE_REQ_TITLE", szDiagSpReqText);
  1085.     endif;   
  1086.    
  1087.     szDiagSpReqText = szDiagSpReqText + szDisk;
  1088.     szDiagSpReqText = szDiagSpReqText + "  ";  
  1089.     
  1090.     GetProfString( szMessages, "Dialogs", "IDC_SPACE_AVAIL_TITLE", szDiagSpAvailText); 
  1091.     szDiagSpAvailText = szDiagSpAvailText + szDisk;  
  1092.     szDiagSpAvailText = szDiagSpAvailText + "  ";   
  1093.     
  1094.     if ( GetProfInt( szSourcePath, "space", szClusterSize + "k", nSpace ) != 0 ) then
  1095.       goto BadInstallINI;
  1096.     endif;     
  1097.                  
  1098.                  
  1099. //----------------------------------------------------------------------------------------
  1100. //  Adjusts disk space amount if the movie doesn't exist and is provided with the course -
  1101. //----------------------------------------------------------------------------------------
  1102.  
  1103.       if (( nMediaType & CD_ROM ) | ( nMediaType & PC_CBT )) then
  1104.          if !( nMediaType & NO_MOVIE ) then
  1105.             if ( szVersion > "4.0" ) then
  1106.                if (FindFile ( szResultPath ^ "SKILLB", "SBMOVIE3.FLI", szText ) != 0 ) then
  1107.                   nSpace = nSpace + 2;
  1108.                endif;
  1109.             elseif ( szVersion > "3.2" ) then
  1110.                if (FindFile ( szResultPath ^ "SKILLB", "SBMOVIE2.FLI", szText ) != 0 ) then
  1111.                   nSpace = nSpace + 3;
  1112.                endif;
  1113.             else
  1114.                if (FindFile ( szResultPath ^ "SKILLB", "SBMOVIE1.FLI", szText ) != 0 ) then
  1115.                   nSpace = nSpace + 3;
  1116.                endif;
  1117.             endif;
  1118.          endif;
  1119.       endif;         
  1120.  
  1121.  
  1122. //  If the course is already installed, checks to see if the current 
  1123. //  installation path is the same as the previous path.  If the paths 
  1124. //  are the same, the disk space check is not made.
  1125.  
  1126.     if ( nCheckSpace = 0 ) then
  1127.       return;       
  1128.     endif;
  1129.  
  1130. // bDone is set to TRUE after clicking on OK from GetInput dialog box.
  1131.        
  1132.     if (( nSpace > nSpaceAvail ) & (bDone = TRUE)) then
  1133.        GetProfString( szMessages, "Titles", "SPACE_TITLE", szText );
  1134.        SetDialogTitle ( DLG_MSG_WARNING, szText );
  1135.        StrToUpper( szDisk, szDisk );
  1136.        szText = SPACE_1;
  1137.        szText = szText + szDisk;
  1138.        szText = szText + SPACE_2;
  1139.        MessageBox (szText, WARNING);
  1140.        GetProfString( szMessages, "Titles", "WARNING", szText );
  1141.        SetDialogTitle ( DLG_MSG_WARNING, szText );
  1142.        bDone = FALSE;
  1143.        return;
  1144.     endif;
  1145.     return;
  1146.  
  1147.            
  1148. //  Checks to make sure that the appropriate animation driver is loaded
  1149. //  on the system to run the movie and installs it if it doesn't exist.
  1150.  
  1151. CheckAnimationDriver:
  1152.     
  1153.     SRCDIR  = szSourcedir;
  1154.     GetFileInfo( szSourcedir ^ "MCIAAP.DRV", FILE_DATE, nResult, szText1);
  1155.     TARGETDIR = szWinSys;
  1156.     if ( FindFile (  TARGETDIR, "mciaap.drv", szText ) != 0 ) then  
  1157.        if ( CopyFile ("mciaap.drv", "mciaap.drv" ) < 0 ) then
  1158.           szText2 = "MCIAAP.DRV";
  1159.           goto AbortAnimationUpdate;
  1160.        endif;
  1161.     else
  1162.         if (GetFileInfo( TARGETDIR ^ "MCIAAP.DRV", FILE_DATE, nResult, szText) = 0 ) then
  1163.            if ( szText1 > szText ) then
  1164.               SRCDIR = WINDIR ^ "SYSTEM";              // Change target directory for copying to Windows directory.
  1165.               DeleteFile( "MCIAAP.SB" );
  1166.               if ( CopyFile ( "MCIAAP.DRV", "MCIAAP.SB" ) < 0 ) then
  1167.                  szText2 = "MCIAAP.DRV";
  1168.                  goto AbortAnimationUpdate;
  1169.               endif;
  1170.               DeleteFile( "MCIAAP.DRV" );
  1171.               SRCDIR  = szSourcedir;
  1172.               if ( CopyFile ( "MCIAAP.DRV", "MCIAAP.DRV" ) < 0) then
  1173.                  szText2 = "MCIAAP.DRV";
  1174.                  goto AbortAnimationUpdate;
  1175.               endif;
  1176.            endif;
  1177.         endif;
  1178.     endif;
  1179.  
  1180.                 
  1181.     TARGETDIR = szWindows;                      // Change target directory for copying to Windows directory.
  1182.     SRCDIR = szWindows;                         // Change target directory for copying to Windows directory.
  1183.     GetSystemInfo ( DATE, nDisk, szDate );                  // Get current date to add to update comments.
  1184.     szChangeDir =  "' " +  szDate + " by Skill Builder.";   // Line used to add comment to updated files.
  1185.     
  1186. CheckSystemIni:    
  1187.  
  1188. //  Verify that SYSTEM.INI is correct.
  1189.  
  1190.     GetProfString( szWindows ^ "SYSTEM.INI", "MCI", "Animation", szFile );
  1191.     if ( szFile = "mciaap.drv" ) then
  1192.       goto CheckWinIni;
  1193.     endif;
  1194.                                       
  1195. //  If incorrect, back up file for user.
  1196.                                       
  1197.     if (CopyFile ( "SYSTEM.INI", "SYSTEM.SB" ) != 0) then
  1198.        szText2 = "SYSTEM.INI";
  1199.        goto AbortAnimationUpdate;
  1200.     endif;
  1201.                                       
  1202.     if ( szFile != "" ) then
  1203.       WriteProfString( szWindows ^ "SYSTEM.INI", "MCI", "Animation", "" );
  1204.       WriteProfString( szWindows ^ "SYSTEM.INI", "MCI", ";Changed from 'Animation", szFile + szChangeDir);
  1205.     endif;  
  1206.     if ( WriteProfString( szWindows ^ "SYSTEM.INI", "MCI", "Animation", "mciaap.drv" ) < 0 ) then
  1207.        szText = "SYSTEM";
  1208.        szText2 = "SYSTEM.INI.";
  1209.        goto AbortAnimationUpdate;
  1210.     endif;                                                                  
  1211.     nInstallOptions = nInstallOptions | UPDATED_SYSTEM_INI;
  1212.  
  1213. CheckWinIni:
  1214.     
  1215. //  Verify that WIN.INI is correct.
  1216.  
  1217.     GetProfString( szWinINI, "mci extensions", "fli", szFile );
  1218.     if ( szFile = "Animation" ) then
  1219.        goto CompleteAnimationUpdate;
  1220.     endif;
  1221.                                       
  1222. //  If incorrect, back up file for user.
  1223.  
  1224.     if (CopyFile ( "WIN.INI", "WIN.SB" ) != 0) then
  1225.        szText2 = "WIN.INI.";
  1226.        goto AbortAnimationUpdate;
  1227.     endif;
  1228.     
  1229.     if ( szFile != "" ) then
  1230.       WriteProfString( szWinINI, "mci extensions", "fli", "" );
  1231.       WriteProfString( szWinINI, "mci extensions", ";Changed from 'fli", szFile + szChangeDir );
  1232.     endif;  
  1233.     if ( WriteProfString( szWinINI, "mci extensions", "fli", "Animation" ) < 0 ) then
  1234.        szText = "WIN";
  1235.        szText2 = "WIN.INI.";
  1236.        goto AbortAnimationUpdate;
  1237.     endif;                                                                  
  1238.     nInstallOptions = nInstallOptions | UPDATED_WIN_INI;
  1239.  
  1240. CompleteAnimationUpdate:
  1241.  
  1242.     szText = "";
  1243.     szFile = "";
  1244.     if ( nInstallOptions & UPDATED_SYSTEM_INI ) then 
  1245.       szText = "SYSTEM.INI";
  1246.       szFile = "SYSTEM.SB";
  1247.     endif;
  1248.     if ( nInstallOptions & UPDATED_WIN_INI ) then 
  1249.       if ( szText = "" ) then
  1250.         szText = "WIN.INI";
  1251.         szFile = "WIN.SB";
  1252.       else
  1253.         szText = szText + ", WIN.INI";  
  1254.         szFile = szFile + ", WIN.SB";  
  1255.       endif;
  1256.     endif;
  1257.     if ( szText != "" ) then
  1258.         GetProfString( szMessages, "Messages", "ANIMATION_1", szUpdate);
  1259.         GetProfString( szMessages, "Messages", "ANIMATION_2", szText1);
  1260.         szUpdate = szUpdate + szText + "\n\n";
  1261.         szUpdate=  szUpdate + szText1 + szFile;
  1262.         GetProfString( szMessages, "Messages", "ANIMATION_3", szText1);
  1263.         MessageBox( szUpdate + "\n\n" + szText1, INFORMATION );
  1264.     endif;  
  1265.     return;
  1266.  
  1267. AbortAnimationUpdate:
  1268.  
  1269.     if ( szText != "" ) then
  1270.       DeleteFile ( szText + ".SB" );
  1271.     endif;  
  1272.     if ( nInstallOptions = nInstallOptions | UPDATED_SYSTEM_INI ) then
  1273.       CopyFile ( "SYSTEM.SB", "SYSTEM.INI" );
  1274.       DeleteFile ( "SYSTEM.SB" );
  1275.     endif;
  1276.     if ( nInstallOptions = nInstallOptions | UPDATED_WIN_INI ) then
  1277.       CopyFile ( "WIN.SB", "WIN.INI" );
  1278.       DeleteFile ( "WIN.SB" );
  1279.     endif;
  1280.     
  1281.     GetProfString( szMessages, "Messages", "ANIMATION_ERR1", szText);
  1282.     GetProfString( szMessages, "Messages", "ANIMATION_ERR2", szText1);
  1283.     szText = szText + szText2 + "\n\n" + szText1;
  1284.     GetProfString( szMessages, "Messages", "ANIMATION_ERR3", szText1);
  1285.     MessageBox ( szText + "\n\n" + szText1,INFORMATION );
  1286.  
  1287.     nInstallOptions = nInstallOptions | ANIMATION_ABORTED;
  1288.        
  1289. //    goto ExitInstall;     
  1290.     return;
  1291.  
  1292. //--------------------------------------------------------------------
  1293. //  This procedure gets a path for Learner Management.
  1294. //--------------------------------------------------------------------
  1295. VerifyLMPath:
  1296.  
  1297. // Check Learner Mamagement path
  1298.  
  1299.     StrSub(szWork, szLMPath,1,1);
  1300.     if (szWork != ":") then
  1301.  
  1302. //  Invalid path entered, reprompt.
  1303.  
  1304.        GetProfString( szMessages, "Messages", "INVALID_PATH", szText);
  1305.        MessageBox (szText, WARNING);
  1306.        bDone = FALSE;
  1307.        GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
  1308.        if ( szLMPath ="") then
  1309.           szLMPath = szResultPath ^ "SKILLB";
  1310.        endif;
  1311.        return;
  1312.     endif;
  1313.     StrLength(szLMPath);
  1314.     nOffset = LAST_RESULT - 1;
  1315.     if (nOffset > -1)  then
  1316.        StrSub(szWork, szLMPath, nOffset, 1);
  1317.        if (StrCompare( szWork, "\\" ) = 0) then  // Trim the last backslash off
  1318.           StrSub(szLMPath, szLMPath, 0, nOffset);
  1319.        endif;
  1320.     endif;    
  1321.  
  1322.     if (ExistsDisk( szDisk ) != EXISTS) then
  1323.        GetProfString( szMessages, "Messages", "INVALID_LM_PATH", szText);
  1324.        MessageBox( szText, WARNING );
  1325.        bDone = FALSE;
  1326.        GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
  1327.        if ( szLMPath ="") then
  1328.          szLMPath = szResultPath ^ "SKILLB";
  1329.        endif;
  1330.        return;
  1331.     endif;
  1332.  
  1333.     if (StrCompare( szLMPath, "C:") = 0) then
  1334.        
  1335.        GetProfString( szMessages, "Messages", "LMPATH_C1", szText );
  1336.        GetProfString( szMessages, "Messages", "LMPATH_C2", szText1 );
  1337.        MessageBox ( szText + szLMPath + szText1, WARNING );
  1338.        bDone = FALSE;
  1339.        GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
  1340.        if ( szLMPath ="") then
  1341.           szLMPath = szResultPath ^ "SKILLB";
  1342.        endif;
  1343.        return;
  1344.     endif;
  1345.     
  1346.     if (ExistsDir ( szLMPath ) != EXISTS) then
  1347.        if ( CreateDir ( szLMPath ) != 0 ) then
  1348.           GetProfString( szMessages, "Messages", "LMGT_DIR_ERR", szText);
  1349.           MessageBox( szText, WARNING );
  1350.           bDone = FALSE;
  1351.           GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
  1352.           if ( szLMPath ="") then
  1353.              szLMPath = szResultPath ^ "SKILLB";
  1354.           endif;
  1355.           return;
  1356.        endif;
  1357.     endif;
  1358.     
  1359. //------------------------------------------------------------------------------------------------
  1360. //  Loads/updates Learner Management file only when Learner Management is ON and the file either -
  1361. //  doesn't exist in the designated directory or on older copy of the file exists.               -
  1362. //------------------------------------------------------------------------------------------------
  1363.  
  1364.     if ( nInstallOptions & SB_LMGT_SELECT) then
  1365.        if (nMediaType & SINGLE_LEARNER) then
  1366.           if ( szVersion > "4.0" ) then
  1367.              bDone = TRUE;
  1368.              return;
  1369.           endif;
  1370.        endif;
  1371.        GetDisk( szSourcedir, szDisk );
  1372.        SRCDIR = szDisk ^ "\\";
  1373.        TARGETDIR = szLMPath;
  1374.        if(FileCompare( "NE_USERS.FMT",
  1375.                        "NE_USERS.FMT", 
  1376.                        COMPARE_DATE ) != LESS_THAN) then
  1377.          if(FileCompare( "NE_USERS.FMT",
  1378.                          "NE_USERS.FMT", 
  1379.                          COMPARE_DATE ) != EQUALS) then
  1380.            if (CopyFile( "NE_USERS.FMT", "NE_USERS.FMT" ) < 0) then
  1381.               GetProfString( szMessages, "Messages", "LMPATH_C1", szText );
  1382.               GetProfString( szMessages, "Messages", "LMPATH_C2", szText1 );
  1383.               MessageBox ( szText + szLMPath + szText1, WARNING );
  1384.               bDone = FALSE;
  1385.               GetProfString( szNETGINI, szCourse, "UserPath", szLMPath );
  1386.               if ( szLMPath ="") then
  1387.                  szLMPath = szResultPath ^ "SKILLB";
  1388.               endif;
  1389.               return;
  1390.            endif;
  1391.         endif;
  1392.       endif;
  1393.     endif;
  1394.     bDone = TRUE;
  1395.     return;
  1396.  
  1397. //-----------------------------------------------------------------------------------------------------
  1398. //        This procedure is called when the course to install is already installed on the hard drive. -
  1399. //-----------------------------------------------------------------------------------------------------
  1400. CoursePresent:
  1401.  
  1402.     GetProfString( szMessages, "Titles", "REINSTALL_VER", szText );
  1403.     SetDialogTitle ( DLG_ASK_YESNO, szText );
  1404.     GetProfString( szMessages, "Messages", "PRESENT_1", szText);
  1405.     szText = szText + szCourse;
  1406.     GetProfString( szMessages, "Messages", "PRESENT_2", szText1);
  1407.     szText = szText + szText1 + "\n";
  1408.     GetProfString( szMessages, "Messages", "PRESENT_3", szText1);
  1409.     szText = szText + szText1;
  1410.     if (AskYesNo( szText, YES ) = NO) then
  1411.        goto ExitInstall;
  1412.     endif;
  1413.     return;
  1414.  
  1415. LoadDisk:
  1416.  
  1417.  
  1418.     FileSetBeginDefine ( "SBFileSet" );
  1419.     
  1420.     Enable ( STATUS );
  1421.     Enable ( FEEDBACK_FULL );
  1422.     if( CompressGet( "COURSE.Z", "", INCLUDE_SUBDIR ) <0) then
  1423.       szText = "COURSE.Z";
  1424.       call CopyError;
  1425.     endif;
  1426.  
  1427. // Line added due to an Install Shield bug which required two compressed files - compress errorr intentionally not tracked. 
  1428.     CompressGet( "GRAPHICS.Z", "", INCLUDE_SUBDIR );
  1429.     
  1430.     FileSetEndDefine ( "SBFileSet" );
  1431.  
  1432. //  Decompressing/Copying files to target directory
  1433. //  Show the % Complete Status Bar
  1434.  
  1435.     Enable ( STATUS );
  1436.     Enable ( FEEDBACK_FULL );
  1437.  
  1438.     GetProfString( szMessages, "Titles", "INS_CRS_FILES", szText );
  1439.     SetStatusWindow(9, szText );
  1440.     StatusUpdate( 9, 96 );
  1441.  
  1442. // Initialize variables
  1443.  
  1444.     nDisk = 1;
  1445.     bDone = FALSE;
  1446.  
  1447. // Perform FileSet
  1448.  
  1449.     while ( !bDone )
  1450.       nResult = FileSetPerform ( "SBFileSet", nDisk);
  1451.       switch ( nResult )
  1452.       case FS_TONEXTDISK:
  1453.         szTagFile = "COURSE.";
  1454.         NumToStr(szExt, nDisk );
  1455.         szTagFile = szTagFile + szExt;
  1456.         GetProfString( szMessages, "Messages", "INSERT_DISK", szText1);
  1457.         szText = szText1 + szExt;
  1458.         MessageBeep (0);
  1459.         EnterDisk (szText, szTagFile );
  1460.         if LAST_RESULT = CANCEL then
  1461.           call ConfirmCancel;
  1462.           EnterDisk (szText, szTagFile );
  1463.           if LAST_RESULT = CANCEL then
  1464.             call ExitInstall;
  1465.           endif;
  1466.         endif;
  1467.       case FS_DONE:
  1468.         // Files transferred successfully
  1469.         bDone = TRUE;
  1470.       case FS_OPERROR:
  1471.         GetProfString( szMessages, "Messages", "DECOMPRESS_ERR", szText1);
  1472.         MessageBox( szText1 + szTagFile, SEVERE );
  1473.         bDone = TRUE;
  1474.       case FS_INCORRECTDISK:
  1475.         GetProfString( szMessages, "Messages", "INCORRECT_DISK", szText);
  1476.         MessageBox( szText, INFORMATION );
  1477.         bDone = TRUE;
  1478.       case FS_OUTOFSPACE:
  1479.         MessageBox( SPACE_TITLE, SEVERE );
  1480.         bDone = TRUE;
  1481.       default:
  1482.         GetProfString( szMessages, "Messages", "DECOMPRESS_ERR", szText1);
  1483.         MessageBox( szText1 + szTagFile, SEVERE );
  1484.         bDone = TRUE;    
  1485.       endswitch;
  1486.     endwhile;
  1487.  
  1488.     return;
  1489.  
  1490. //--------------------------------------------------------------------
  1491. //            This procedure installs decompresses and copies        -
  1492. //                   files from the source CD drive.                 -
  1493. //--------------------------------------------------------------------
  1494.  
  1495. LoadCD:
  1496.  
  1497. // ----------------------------------------------------------------------
  1498. //  If single-user version (network=no), checks WIN.INI file for NETG
  1499. //  sounds and adds sounds with default settings if they do not exist.
  1500. //  If sounds exist, does nothing.
  1501. // ----------------------------------------------------------------------
  1502.  
  1503.       if ( nMediaType & CD_ROM ) then
  1504.          if ( szVersion > "4.0" ) then  // Course is  running off of CD - a new reference with "4" added
  1505.            
  1506.            GetProfString( szWinINI, "Sounds", "NETG4Rewind", szText );
  1507.            if ( szText = "" ) then
  1508.               WriteProfString (szWinINI, "Sounds", "NETG4Rewind",   TARGETDIR^"NE_back.wav,NETG Rewind" );
  1509.               WriteProfString (szWinINI, "Sounds", "NETG4Forward",  TARGETDIR^"NE_click.wav,NETG Page Forward" );
  1510.               WriteProfString (szWinINI, "Sounds", "NETG4FForward", TARGETDIR^"NE_next.wav,NETG Fast Forward" );
  1511.               WriteProfString (szWinINI, "Sounds", "NETG4Map",      TARGETDIR^"NE_map.wav,NETG Course Map" );
  1512.               WriteProfString (szWinINI, "Sounds", "NETG4Exit",     TARGETDIR^"NE_exit.wav,NETG Exit" );
  1513.            endif;
  1514. //*******************************************************************************************************
  1515. //
  1516. //          Special message added for 70011 - Windows 95 Product
  1517. //
  1518. //*******************************************************************************************************          
  1519.          Disable( EXIT );           // Exit Button
  1520.          DefineDialog ( "SLUGGISH", 0, szDialogs, SLUGGISH, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED );
  1521.          bDone = FALSE;
  1522.          while (bDone = FALSE)
  1523.        
  1524.          nCmdValue = WaitOnDialog ("SLUGGISH");
  1525.          switch ( nCmdValue )
  1526.     
  1527.            case DLG_INIT:  
  1528.               Delay(15);
  1529.               bDone = TRUE;
  1530.          endswitch;
  1531.          endwhile;
  1532.         EndDialog ("SLUGGISH");
  1533.         ReleaseDialog ("SLUGGISH");
  1534.  
  1535.  
  1536.           
  1537.       return;                  //  Return and do not attempt to load files to the hard drive.
  1538.            
  1539.         else                        //  Course loaded to the hard drive with WAV files installed to SKILLB
  1540.            
  1541.            GetProfString( szWinINI, "Sounds", "NETGRewind", szText );
  1542.            if ( szText = "" ) then
  1543.               WriteProfString (szWinINI, "Sounds", "NETGRewind",   TARGETDIR^"NE_back.wav,NETG Rewind" );
  1544.               WriteProfString (szWinINI, "Sounds", "NETGForward",  TARGETDIR^"NE_click.wav,NETG Page Forward" );
  1545.               WriteProfString (szWinINI, "Sounds", "NETGFForward", TARGETDIR^"NE_next.wav,NETG Fast Forward" );
  1546.               WriteProfString (szWinINI, "Sounds", "NETGMap",      TARGETDIR^"NE_map.wav,NETG Course Map" );
  1547.               WriteProfString (szWinINI, "Sounds", "NETGExit",     TARGETDIR^"NE_exit.wav,NETG Exit" );
  1548.            endif;
  1549.  
  1550.         endif;
  1551.         Enable ( STATUS );
  1552.         Enable ( FEEDBACK_FULL );
  1553.         if( CompressGet( "MISC.Z", "", COMP_UPDATE_DATE_NEWER ) <0) then  // Install/Update sounds and/or Movie
  1554.            szText = "MISC.Z";
  1555.            call CopyError;
  1556.         endif;
  1557.     endif;  
  1558.     Enable ( STATUS );
  1559.     Enable ( FEEDBACK_FULL );
  1560.  
  1561.     GetProfString( szMessages, "Titles", "INS_CRS_FILES", szText );
  1562.     SetStatusWindow(9, szText );
  1563.     StatusUpdate( 9, 97 );
  1564.  
  1565.     if( CompressGet( "COURSE.Z", "", INCLUDE_SUBDIR ) <0) then
  1566.       szText = "COURSE.Z";
  1567.       call CopyError;
  1568.     endif;
  1569.  
  1570. // Line added due to an Install Shield bug which required two compressed files - compress error intentionally not tracked. 
  1571.  
  1572.     CompressGet( "GRAPHICS.Z", "", INCLUDE_SUBDIR );
  1573.  
  1574.     return;
  1575.  
  1576. //--------------------------------------------------------------------
  1577. //  Updates course specific information in the  NETG.INI file
  1578. //--------------------------------------------------------------------
  1579.     UpdateNETGINI:
  1580.  
  1581.     if ( nPresent = 1 ) then
  1582.       WriteProfString( szNETGINI, szCourse, "", "" );
  1583.     endif;
  1584.  
  1585.     if ( szVersion > "4.0" ) then
  1586.        if ( nInstallOptions & MASTERY_FULL_SELECT ) then
  1587.           WriteProfString( szNETGINI, szCourse, "Feedback", "2" );
  1588.        elseif ( nInstallOptions & MASTERY_PARTIAL_SELECT ) then
  1589.           WriteProfString( szNETGINI, szCourse, "Feedback", "1" );
  1590.        else
  1591.           WriteProfString( szNETGINI, szCourse, "Feedback", "0" );
  1592.        endif;  
  1593.     endif;
  1594.  
  1595.     if ( nMediaType & CD_ROM ) then
  1596.       WriteProfString( szNETGINI, szCourse, "CDRom", "1" );
  1597.       WriteProfString( szNETGINI, szCourse, "EnableFlag", "6" );  
  1598.     else
  1599.       WriteProfString( szNETGINI, szCourse, "CDRom", "0" );
  1600.       WriteProfString( szNETGINI, szCourse, "EnableFlag", "2" );
  1601.     endif;
  1602.  
  1603.     if ( szVersion > "3.0" ) then
  1604.       if ( nInstallOptions & TIME_OUT ) then
  1605.         WriteProfString( szNETGINI, "NETGctlintf", "TimeOut", "50" );
  1606.       else
  1607.         WriteProfString( szNETGINI, "NETGctlintf", "TimeOut", "0" );
  1608.       endif;
  1609.     endif;
  1610.  
  1611.     if ( szVersion > "3.1c" ) then
  1612.       WriteProfString( szNETGINI, szCourse, "AutoPageForward", szAutoPage );
  1613.     endif;
  1614.  
  1615.     if ( nInstallOptions & SB_LMGT_SELECT ) then
  1616.        WriteProfString( szNETGINI, szCourse, "UserPath", szLMPath );
  1617.        if (szVersion > "4.0") then
  1618.           if (nMediaType & SINGLE_LEARNER) then
  1619.              WriteProfString( szNETGINI, szCourse, "StudentMgt", "3" );
  1620.           else
  1621.              WriteProfString( szNETGINI, szCourse, "StudentMgt", "1" );
  1622.           endif;   
  1623.        else
  1624.           WriteProfString( szNETGINI, szCourse, "StudentMgt", "1" );
  1625.        endif;   
  1626.     endif;  
  1627.  
  1628.     if ( nInstallOptions & SV_MANAGER_SELECT ) then
  1629.       WriteProfString( szNETGINI, szCourse, "StudentMgt", "2" );
  1630.     endif;
  1631.  
  1632.     if ( nInstallOptions & NO_MGT_SELECT ) then
  1633.       WriteProfString( szNETGINI, szCourse, "StudentMgt", "0" );
  1634.     endif;
  1635.  
  1636. //  Sets a language flag to Microsoft's 3 character code which is
  1637. //  set in the file
  1638.  
  1639.     WriteProfString( szNETGINI, szCourse, "Lang", szLang );
  1640.     
  1641.     WriteProfString( szNETGINI, szCourse, "Version", szVersion );
  1642.     
  1643.     if nPresent = 0
  1644.     then
  1645.       GetProfString( szNETGINI, "Course", "Total", szText );
  1646.       StrToNum( nTotalCourse, szText );
  1647.       GetProfString( szNETGINI, szCourse, "Path", szText );
  1648.       if (StrLength( szText ) = 0) then                      // Course not in list - add it to course# list in NETG.INI
  1649.          WriteProfString( szNETGINI, "Course", "Total", "" );
  1650.          nTotalCourse = nTotalCourse + 1;
  1651.          NumToStr( szTotal, nTotalCourse );
  1652.          WriteProfString( szNETGINI, "Course", "Total", szTotal );
  1653.          szText = "Name";
  1654.          szText = szText + szTotal;
  1655.          WriteProfString( szNETGINI, "Course", szText, szCourse );
  1656.       endif;
  1657.     endif;
  1658.     GetProfString( szNETGINI, "NETGctlintf", "nedebug", szText );
  1659.     StrLength( szText );
  1660.     if LAST_RESULT != 0
  1661.         then
  1662.       WriteProfString( szNETGINI, "NETGctlintf", "nedebug", "" );
  1663.         endif;
  1664.     WriteProfString( szNETGINI, szCourse, "Path", szResultPath );
  1665.     return;    
  1666.  
  1667. //--------------------------------------------------------------------
  1668. //            This procedure creates the NETG Skill Builder          -
  1669. //                 program group and icon for windows.               -
  1670. //--------------------------------------------------------------------
  1671. Complete:
  1672.  
  1673.     GetProfString( szMessages, "Titles", "INIT_PG_ICON", szText );
  1674.     SetStatusWindow( 98, szText );
  1675.  
  1676. //  Write out path and command line to run course from icon
  1677.  
  1678.     szCommand = szCoursePath;
  1679.     szCommand = szCommand ^ "PRESENT";
  1680.     szWork = szCommand;         // Define working directory.
  1681.     szCommand = szCommand ^ "PRESENT";
  1682.     szExec = szCommand + ".EXE ";  // Added .EXE for PROPERTY.TXT "EXEC=" line
  1683.     szCommand = szCommand + " ";
  1684.     szPath = "..\\ICONWARE" ^ szCourse;
  1685.     szPath = szPath + ".IW";
  1686.     szCommand = szCommand + szPath;
  1687.     szExec = szExec + szPath;
  1688.  
  1689. //  Write out path to course icon file.
  1690.  
  1691.     szPath = szCoursePath ^ "PRESENT"; 
  1692.     szPath = szPath ^ szIconFile;
  1693.  
  1694. //------------------------------------------------------------------------
  1695. //    Create batch file for VSI Menu install (Must be at least v1.45)    -
  1696. //------------------------------------------------------------------------
  1697.  
  1698.        szIVIPath = "WIN ";
  1699.        szIVIPath = szIVIPath + szCommand; 
  1700.        szFile = szCourse;
  1701.        szFile = szFile + ".BAT";
  1702.        GetDisk( szNETGINI, szText );
  1703.        szText = szText + "\\";
  1704.  
  1705. //---------------------------------------------------------------------------
  1706. //  Added functionality to not create an icon or batch file when 
  1707. //  SkillVantage Manager is selected or for the SkillVantage Manager tutorial
  1708. //---------------------------------------------------------------------------
  1709.  
  1710.        if !(( nInstallOptions & SV_MANAGER_SELECT ) | ( szVersion = "3.2x" )) then
  1711.           CreateFile( nHan, szText, szFile );
  1712.           WriteLine( nHan, szIVIPath );
  1713. //       szPgrp = "NETG SB Courseware";
  1714.        if ( AddProgItemEx( szPgrp, szIconTag, szCommand, szWork, szPath, 0, "", REPLACE ) < 0 )
  1715.           then
  1716.              GetProfString( szMessages, "Messages", "CREATE_ICON_ERR", szText);
  1717.              MessageBox( szText, WARNING );
  1718.           endif;
  1719.        endif;   
  1720.  
  1721.  
  1722. // ----------------------------------------------------------------------
  1723. //  Copies the course WS.INI file to course sub directory and updates 
  1724. //  the lines with install specific data for multiuser courses and 
  1725. //  modifies course VAR file so the movie doesn't play.
  1726. // ----------------------------------------------------------------------
  1727.  
  1728. UpdateWsIni:
  1729.  
  1730.       if ( nMediaType & LAN ) then
  1731.         szFile = szResultPath ^ "SKILLB\\WS\\WS.INI";
  1732.         WriteProfString( szFile, szCourse, "icon", szIconTag );
  1733.         WriteProfString( szFile, szCourse, "iconfile", szIconFile );    
  1734.         WriteProfString( szFile, szCourse, "version", szVersion );
  1735.         WriteProfString( szFile, szCourse, "Lang", szLang );
  1736.         if ( nInstallOptions & SV_MANAGER_SELECT ) then
  1737.           WriteProfString( szFile, szCourse, "StudentMgt", "2" );
  1738.         elseif ( nMediaType & NO_SKILLB_LMGT ) then
  1739.           WriteProfString( szFile, szCourse, "StudentMgt", "no" );
  1740.         else
  1741.           WriteProfString( szFile, szCourse, "StudentMgt", "0" );
  1742.         endif;
  1743.         if ( szVersion > "4.0" ) then
  1744.            if ( nInstallOptions & MASTERY_FULL_SELECT ) then
  1745.               WriteProfString( szFile, szCourse, "Feedback", "2" );
  1746.            elseif ( nInstallOptions & MASTERY_PARTIAL_SELECT ) then
  1747.               WriteProfString( szFile, szCourse, "Feedback", "1" );
  1748.            else
  1749.               WriteProfString( szFile, szCourse, "Feedback", "0" );
  1750.            endif;  
  1751.         endif;
  1752.       endif;
  1753.  
  1754. // ----------------------------------------------------------------------
  1755. //  Creates a file called "PROPERTY.TXT" which resides in the course 
  1756. //  directory that contains information to help students create CDF files.
  1757. // ----------------------------------------------------------------------
  1758.  
  1759.       OpenFileMode ( FILE_MODE_APPEND );
  1760.       CreateFile ( nFile, szCoursePath, "PROPERTY.TXT" );
  1761.       OpenFile ( nFile, szCoursePath, "PROPERTY.TXT" );
  1762.       WriteLine ( nFile, "Course Runtime Information");
  1763.       WriteLine ( nFile, "");
  1764.       WriteLine ( nFile, "");
  1765.       WriteLine ( nFile, "Course Startup Command:");
  1766.       WriteLine ( nFile, szExec );
  1767.       WriteLine ( nFile, "");
  1768.       WriteLine ( nFile, "Working Directory:");
  1769.       WriteLine ( nFile, szWork);
  1770.       WriteLine ( nFile, "");
  1771.       WriteLine ( nFile, "");
  1772.       WriteLine ( nFile, "");
  1773.       CloseFile ( nFile );
  1774.  
  1775. // --------------------------------------------------------------------------------
  1776. //    Updates OPENING.VAR file for PC/CBT & CD courses with registration information
  1777. // --------------------------------------------------------------------------------
  1778.  
  1779.     if ((nMediaType & CD_ROM) | (nMediaType & PC_CBT)) then
  1780.  
  1781.        OpenFile ( nFile, szCoursePath ^ "VAR_" + szLang, "OPENING.VAR" );
  1782.        WriteLine ( nFile, "@copy5");
  1783.        GetProfString( szMessages, "Messages", "LICENCE_MESSAGE", szText);
  1784.        WriteLine ( nFile, szText);
  1785.        WriteLine ( nFile, "@copy6");
  1786.        WriteLine ( nFile, szName);
  1787.        WriteLine ( nFile, "@copy7");
  1788.        WriteLine ( nFile, szCompany );
  1789.        CloseFile ( nFile );
  1790.  
  1791.     endif;                     
  1792.     
  1793. // --------------------------------------------------------------------------------
  1794. //    Updates COURSE.VAR file for PC/CBT & CD courses when the animation driver is 
  1795. //    not installed and a problem occurs when attempting to add this driver   
  1796. //    Need to add code to automatically get first letter for international installs
  1797. // --------------------------------------------------------------------------------
  1798.     
  1799.     if ((nInstallOptions & ANIMATION_ABORTED ) | ( nMediaType & LAN )) then  //  turn the movie off. 
  1800.  
  1801.        OpenFile ( nFile, szCoursePath ^ "VAR_" + szLang, "A" + szCourse + ".VAR" );      //***** needs to be internationalized
  1802.        WriteLine ( nFile, "@nomovie");
  1803.        WriteLine ( nFile, "1");
  1804.        CloseFile ( nFile );
  1805.  
  1806.     endif;                     
  1807.     return;
  1808.     
  1809. //--------------------------------------------------------------------
  1810. //   This procedure is called when SkillVantage is selected for the  -
  1811. //   current installation - NETG.INI is queried to check if verify   -
  1812. //   StudentMgt is set to 2 for all courses at version 3.1 or later  -
  1813. //   - for LAN installations, WS.INI is checked as well to ensure    -
  1814. //   StudentMgt is set to 2 - If StudentMgt is set to 0, a prompt    -
  1815. //   displays asking the user if s/he wants to set all courses to    -
  1816. //   run with SkillVantage Manager.                                  -
  1817. //--------------------------------------------------------------------
  1818. CheckSkillVantage:
  1819.  
  1820.     GetProfString( szMessages, "Titles", "INIT_PG_ICON", szText );
  1821.     SetStatusWindow( 98, szText );
  1822.  
  1823. //  Create  lists for updating files for SkillVantage Manager    
  1824.  
  1825.        listID1 = ListCreate( STRINGLIST );
  1826.        listID2 = ListCreate( STRINGLIST );
  1827.        wsDirList = ListCreate( STRINGLIST );
  1828.  
  1829. //  For LAN installations, create a list directories for current install
  1830. //  and definition to point to WS.INI file
  1831.  
  1832.       if ( nMediaType & LAN ) then
  1833.          FindAllDirs ( szResultPath ^ "SKILLB", EXCLUDE_SUBDIR, wsDirList );
  1834.          szFile = szResultPath ^ "\\SKILLB\\WS\\WS.INI";
  1835.       endif;
  1836.  
  1837. //  Create a list of icon names in the Skill Builder program group
  1838.  
  1839.        GetItemNameList ( szPgrp, listID1 );
  1840.        GetProfString(szNETGINI, "Course", "Total", szTotal );
  1841.        StrToNum( nTotalCourse, szTotal );
  1842.        szUpdateSkillV = "0";
  1843.        for nCount = 1 to nTotalCourse
  1844.          NameNum = "Name";
  1845.          NumToStr( szCount, nCount );       // Build NAMEn Keyname
  1846.          NameNum = NameNum + szCount;
  1847.          GetProfString( szNETGINI, "Course", NameNum, szCourse );
  1848.          if ( GetProfString(szNETGINI, szCourse, "StudentMgt", szStMgt ) < 0 ) then
  1849.             szStMgt = "";
  1850.          endif;
  1851.          GetProfString(szNETGINI, szCourse, "Path", szPath );
  1852.             if (((szStMgt = "0") | (szStMgt = "1")) & (szUpdateSkillV = "0" )) then
  1853.                GetProfString( szMessages, "Titles", "UPDATE_SV_DLG", szText);
  1854.                SetDialogTitle( DLG_ASK_YESNO, szText );
  1855.                GetProfString( szMessages, "Messages", "UPDATE_TO_SV", szText);
  1856.                szText = szText + "\n\n";
  1857.                GetProfString( szMessages, "Messages", "UPDATE_TO_SV1", szText1);
  1858.                szText = szText + szText1 + "\n\n";
  1859.                GetProfString( szMessages, "Messages", "UPDATE_TO_SV2", szText1);
  1860.                if (AskYesNo (szText + szText1, YES ) = YES) then 
  1861.                   szUpdateSkillV = "2";
  1862.                else
  1863.                   szUpdateSkillV = "1";
  1864.                endif;   
  1865.             endif;
  1866.          if (((szStMgt = "0") | (szStMgt = "1")) & ( szUpdateSkillV = "2" )) then
  1867.             WriteProfString( szNETGINI, szCourse, "StudentMgt", "2" );
  1868.             szStMgt = "2";
  1869.          endif;   
  1870.          if (szStMgt = "2") then
  1871.             call DeleteIcon; 
  1872.             if (FindFile ( szPath^"SKILLB\\WS", "WS.INI", szText ) = 0 ) then
  1873.                WriteProfString( szPath^"SKILLB\\WS\\WS.INI", szCourse, "StudentMgt", "2" );
  1874.             endif;
  1875.          endif;   
  1876.          endfor;
  1877.          if (ListGetFirstString( listID2, szItemName ) != END_OF_LIST) then
  1878.             ShowGroup ( szPgrp, SW_SHOWMINNOACTIVE );
  1879.             ShowGroup ( szPgrp, SW_NORMAL );
  1880.             DeleteProgItem ( szPgrp, szItemName, "");
  1881.             lResult = 0; 
  1882.             while (lResult != END_OF_LIST )
  1883.                lResult = ListGetNextString( listID2, szItemName );
  1884.                ShowGroup ( szPgrp, SW_SHOWMINNOACTIVE );
  1885.                ShowGroup ( szPgrp, SW_NORMAL );
  1886.                DeleteProgItem ( szPgrp, szItemName, ""); 
  1887.             endwhile;
  1888.          endif;
  1889.  
  1890. //  If user requested not to update courses to SkillVantage, doesn't check WS.INI file
  1891.          
  1892.          if ( szUpdateSkillV = "1" ) then
  1893.             return;
  1894.          endif;
  1895.  
  1896. //  Check WS.INI files for current course installation subdirectory
  1897.          
  1898.          if ( nMediaType & LAN ) then
  1899.             ListGetFirstString( wsDirList, szCoursePath );
  1900.             call SkillVantageWSINI;
  1901.             lResult = 0; 
  1902.             while (lResult != END_OF_LIST )
  1903.                lResult = ListGetNextString( wsDirList, szCoursePath );
  1904.                call SkillVantageWSINI;
  1905.             endwhile;
  1906.          endif;
  1907.         return;
  1908.         
  1909. // ----------------------------------------------------------------------
  1910. //  Subroutine that checks for icons to delete from the NETG SB Courseware directory
  1911. // ----------------------------------------------------------------------
  1912.  
  1913. DeleteIcon:
  1914.  
  1915. //  Build Command Lines for course to delete icon
  1916.  
  1917.     StrToUpper ( szPath, szPath );
  1918.     szCoursePath = szPath ^ "SKILLB\\";
  1919.     szCoursePath = szCoursePath + szCourse;
  1920.     szCommand = szCoursePath ^ "PRESENT\\PRESENT ";
  1921.     szCommand = szCommand + szCoursePath;
  1922.     szCommand = szCommand ^ "ICONWARE";
  1923.     szCommand = szCommand ^ szCourse;
  1924.     szCommand = szCommand + ".IW";
  1925.  
  1926.     szCommand2 = szCoursePath ^ "PRESENT\\PRESENT ";
  1927.     szCommand2 = szCommand2 + "..\\ICONWARE";
  1928.     szCommand2 = szCommand2 ^ szCourse;
  1929.     szCommand2 = szCommand2 + ".IW";
  1930.     
  1931.     szCommand3 = szCoursePath ^ "PRESENT\\PRESENT.EXE ";
  1932.     szCommand3 = szCommand3 + "..\\ICONWARE";
  1933.     szCommand3 = szCommand3 ^ szCourse;
  1934.     szCommand3 = szCommand3 + ".IW";
  1935.     
  1936.     szCommand4 = szCoursePath ^ "PRESENT\\PRESENT.EXE ";
  1937.     szCommand4 = szCommand4 + szCoursePath;
  1938.     szCommand4 = szCommand4 ^ "ICONWARE";
  1939.     szCommand4 = szCommand4 ^ szCourse;
  1940.     szCommand4 = szCommand4 + ".IW";
  1941.  
  1942. //  Check the command line built above against the icons in NETG SB Courseware - if the match, add an icon name to list to delete    
  1943.     
  1944.     lResult = 0;
  1945.     if (ListGetFirstString( listID1, szItemName ) != END_OF_LIST) then
  1946.       QueryProgItem( szPgrp, szItemName, svCmdLine, svWrkDir, svIconPath, nvIconIndex, svShortCutKey, nvMinimizeFlag );
  1947.       StrToUpper ( svCmdLine, svCmdLine );
  1948.       if (( szCommand = svCmdLine )|( szCommand2 = svCmdLine ))|(( szCommand3 = svCmdLine )|( szCommand4 = svCmdLine )) then
  1949.          ListAddString( listID2, szItemName, AFTER );
  1950.       endif;
  1951.       while (lResult != END_OF_LIST )
  1952.         lResult = ListGetNextString( listID1, szItemName );
  1953.         QueryProgItem( szPgrp, szItemName, svCmdLine, svWrkDir, svIconPath, nvIconIndex, svShortCutKey, nvMinimizeFlag );
  1954.         StrToUpper ( svCmdLine, svCmdLine );
  1955.           if ((((szCommand=svCmdLine)|(szCommand2=svCmdLine))|((szCommand3=svCmdLine)|(szCommand4=svCmdLine)))&lResult!=END_OF_LIST) then
  1956.            ListAddString( listID2, szItemName, AFTER );
  1957.         endif;
  1958.       endwhile;
  1959.     endif;
  1960.     return;
  1961.  
  1962. //  Updates WS.INI file for based on CoursePath values
  1963.  
  1964. SkillVantageWSINI:
  1965.     
  1966.     StrLength (szCoursePath);
  1967.     nOffset = LAST_RESULT - 6;
  1968.     StrSub( szCourse, szCoursePath, nOffset, 5 ); 
  1969.     GetProfString( szFile, szCourse, "StudentMgt", szStMgt );
  1970.     if (((szStMgt = "0") | (szStMgt = "1")) & (szUpdateSkillV = "0" )) then
  1971.        GetProfString( szMessages, "Titles", "UPDATE_SV_DLG", szText );
  1972.        SetDialogTitle( DLG_ASK_YESNO, szText );
  1973.        GetProfString( szMessages, "Messages", "UPDATE_TO_SV", szText);
  1974.        szText = szText + "\n\n";
  1975.        GetProfString( szMessages, "Messages", "UPDATE_TO_SV1", szText1);
  1976.        szText = szText + szText1 + "\n\n";
  1977.        GetProfString( szMessages, "Messages", "UPDATE_TO_SV2", szText1);
  1978.        if (AskYesNo (szText + szText1, YES ) = YES) then 
  1979.           szUpdateSkillV = "2";
  1980.        endif;   
  1981.     endif;
  1982.     if (((szStMgt = "0") | (szStMgt = "1")) & (szUpdateSkillV = "2")) then
  1983.        WriteProfString( szFile, szCourse, "StudentMgt", "2" );
  1984.     endif;
  1985.     return;
  1986.  
  1987.  
  1988. //--------------------------------------------------------------------
  1989. //          This procedure will display an error when Install        -
  1990. //               is unable to decompress or copy a file.             -
  1991. //--------------------------------------------------------------------
  1992. CopyError:
  1993.  
  1994.        GetProfString( szMessages, "Messages", "DECOMPRESS_ERR", szText1);
  1995.        MessageBox( szText1 + szText, SEVERE );
  1996.        return;
  1997.        
  1998.   
  1999.  
  2000. //-----------------------------------------------------------------------------
  2001. // VARIABLES:
  2002. //      szResultPath - default or previously entered path to install the course
  2003. //      szText - Text to append to the default path 
  2004. //      szCourse - Course number used to generate default path
  2005. // PURPOSE
  2006. //             This subroutine displays a dialog box which allows the user to 
  2007. //             change default path for installing either course files or Skill 
  2008. //             Builder Learner Management files.
  2009. //
  2010. //-----------------------------------------------------------------------------
  2011. ChangeDir:
  2012.  
  2013.  
  2014.         DefineDialog ("CHANGE_DIRECTORY", 0, szDialogs, CHANGE_DIRECTORY, "", HWND_DESKTOP, HWND_INSTALL, DLG_CENTERED );
  2015.         bDone2 = FALSE;
  2016.         while (bDone2 = FALSE )
  2017.           nCmdValue2 = WaitOnDialog ("CHANGE_DIRECTORY");
  2018.           switch ( nCmdValue2 )
  2019.             case DLG_INIT:
  2020.               nOffset = StrLength(szChangeDir);
  2021.               StrSub(szText, szChangeDir, nOffset - 1, 1);
  2022.               if (StrCompare(szText, "\\") != 0 ) then
  2023.                  szChangeDir = szChangeDir + "\\";
  2024.               endif;
  2025.               StrSub( szDisk, szChangeDir, 0, 2);
  2026.               StrSub( szText, szChangeDir, 0, 1);
  2027.               CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
  2028.               call CreateDirList;  
  2029.               CtrlDir("CHANGE_DIRECTORY", ID_DRIVES, szChangeDir + "*.*", DLG_DIR_DRIVE);
  2030.  
  2031.               StrSub( szText, szChangeDir, 0, 1);
  2032.               CtrlSetCurSel("CHANGE_DIRECTORY", ID_DRIVES, "[-"+ szText +"-]");
  2033.               CtrlSelectText( "CHANGE_DIRECTORY", ID_CHANGE_PATH );
  2034.  
  2035.             case IDOK:
  2036.               CtrlGetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szNewPath);
  2037.               nOffset = StrLength(szNewPath);
  2038.               StrSub( szText, szNewPath, nOffset - 13, 13);
  2039.               if (StrCompare(szText, "SKILLB\\" + szCourse + "\\") = 0) then
  2040.                  StrSub( szNewPath, szNewPath, 0, nOffset - 13);
  2041.               endif;        
  2042.               StrToUpper(szNewPath, szNewPath);
  2043.               szText = "OK";
  2044.               bDone2 = TRUE;
  2045.               call VerifyTarget;
  2046.               
  2047.             case IDCANCEL:
  2048.               szText = "NO";
  2049.               bDone2 = TRUE;
  2050.  
  2051.             case IDHELP:
  2052.               szText = "Change Directory";
  2053.               call Help_Handler;
  2054.  
  2055.             case DLG_CLOSE:
  2056.               szText = "NO";
  2057.               bDone2 = TRUE;
  2058.  
  2059.             case ID_DIRECTORIES:
  2060.               nCmdValue2 = CtrlGetSubCommand("CHANGE_DIRECTORY");
  2061.               switch ( nCmdValue2 )
  2062.                 case LISTBOX_SELECT:
  2063.                 
  2064.                 case LISTBOX_ENTER:
  2065.                   CtrlGetCurSel("CHANGE_DIRECTORY", ID_DIRECTORIES, szNewPath);
  2066.                   StrToUpper(szNewPath, szNewPath);
  2067.                   nOffset = StrLength(szNewPath);
  2068.                   StrSub(szNewPath, szNewPath, 1, nOffset - 2 );
  2069.                   if (StrCompare( szNewPath, ".." ) = 0) then
  2070.                      nOffset = StrLength(szChangeDir);
  2071.                      nCount = 1;
  2072.                      szText = "";
  2073.                      while (szText != "\\")
  2074.                         nCount++;
  2075.                         StrSub(szText, szChangeDir, nOffset - nCount, 1);
  2076.                      endwhile;
  2077.                      StrSub( szChangeDir, szChangeDir, 0, (nOffset - nCount) + 1);
  2078.                   else
  2079.                      szChangeDir = szChangeDir ^ szNewPath + "\\";
  2080.                   endif;
  2081.                   CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
  2082.                   call CreateDirList;  
  2083.                endswitch;
  2084.  
  2085.             case ID_DRIVES:
  2086.               nCmdValue2 = CtrlGetSubCommand("CHANGE_DIRECTORY");
  2087.               switch ( nCmdValue2 )
  2088.                 case COMBOBOX_SELECT:
  2089.                   CtrlGetCurSel("CHANGE_DIRECTORY", ID_DRIVES, szDisk);
  2090.                   StrSub(szDisk, szDisk, 2, 1);
  2091.                   StrToUpper(szDisk, szDisk);
  2092.                   szChangeDir = szDisk + ":\\";
  2093.                   CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
  2094.                   call CreateDirList;  
  2095.                 case EDITBOX_CHANGE:
  2096.                   CtrlGetText("CHANGE_DIRECTORY", ID_DRIVES, szText); 
  2097.                   szDisk = "[-" + szText + "-]";
  2098.                   StrToUpper(szDisk, szDisk);
  2099.                   szChangeDir = szDisk + ":\\";
  2100.                   CtrlSetCurSel("CHANGE_DIRECTORY", ID_DRIVES, szText);
  2101.                   CtrlSetText( "CHANGE_DIRECTORY", ID_CHANGE_PATH, szChangeDir ^ szCoursePath );
  2102.                   call CreateDirList;  
  2103.                   CtrlGetCurSel("CHANGE_DIRECTORY", ID_DRIVES, szDisk);
  2104.               endswitch;
  2105.           endswitch;
  2106.       endwhile;
  2107.       EndDialog ("CHANGE_DIRECTORY");
  2108.       ReleaseDialog ("CHANGE_DIRECTORY");
  2109.       return; 
  2110.       
  2111. CreateDirList:
  2112.  
  2113.  
  2114.     nResult = 0;
  2115.     nResult = ListGetFirstString(ChangeDirList, svWrkDir);
  2116.     while (nResult != END_OF_LIST)
  2117.        ListDeleteString (ChangeDirList);
  2118.        nResult = ListGetFirstString(ChangeDirList, svWrkDir);
  2119.     endwhile;
  2120.  
  2121.     
  2122.     nOffset=StrLength(szChangeDir);
  2123.     FindAllDirs (szChangeDir, EXCLUDE_SUBDIR, ChangeDirList);
  2124.     nResult = ListGetFirstString(ChangeDirList, svWrkDir);
  2125.     if (nResult = 1) then
  2126.         ListAddString ( ChangeDirList, "[..]", BEFORE );
  2127.          CtrlSetList ( "CHANGE_DIRECTORY", ID_DIRECTORIES, ChangeDirList );
  2128.         return;
  2129.     endif;
  2130.     nOffset=StrLength(svWrkDir);
  2131.     nCount = nOffset - 1;
  2132.     szText="";
  2133.     while (StrCompare(szText,"\\") != 0)
  2134.         nCount--;
  2135.         StrSub(szText,svWrkDir,nCount,1);
  2136.     endwhile;
  2137.     nCount = nCount + 1;
  2138.     nResult = 0;
  2139.     while (nResult != END_OF_LIST)
  2140.         nOffset=StrLength(svWrkDir);
  2141.         nOffset=nOffset - 1;
  2142.         StrSub(svWrkDir, svWrkDir, nCount, nOffset - nCount );
  2143.         svWrkDir = "[" + svWrkDir + "]";
  2144.         nResult = ListSetCurrentString (ChangeDirList, svWrkDir);
  2145.         nResult = ListGetNextString(ChangeDirList, svWrkDir);
  2146.     endwhile;
  2147.     if ( nCount > 3 ) then
  2148.         ListAddString ( ChangeDirList, "[..]", BEFORE );
  2149.     endif;
  2150.     CtrlSetList ( "CHANGE_DIRECTORY", ID_DIRECTORIES, ChangeDirList );
  2151.     return;
  2152.  
  2153. Exit_Handler:
  2154.  
  2155.     GetProfString( szMessages, "Messages", "EXIT_ASK_MESG", szText);
  2156.     if (AskYesNo (szText, YES) = YES) then
  2157.         goto ExitInstall;           
  2158.     endif;
  2159.     return;
  2160.  
  2161. Help_Handler:
  2162.  
  2163.     nHwdInstall = GetWindowHandle(HWND_INSTALL);
  2164.  //   if (StrCompare(szText,"Change Directory") = 0) then
  2165.  //      WinHelp( nHwdInstall, SRCDIR ^ "instlhlp.hlp", HELP_CONTEXT, 11 );
  2166.  //   else
  2167.        WinHelp( nHwdInstall, szSourcedir ^ "instlhlp.hlp", HELP_CONTENTS, 0 );
  2168.  //   endif;   
  2169.     hWnd = FindWindow( "MS_WINHELP", "");
  2170.     ShowWindow ( hWnd, SW_SHOW );
  2171.     return;
  2172.                        
  2173. //--------------------------------------------------------------------
  2174. //              This procedure sets the error message                -
  2175. //             Invalid INSTALL.INI file on hard drive                -
  2176. //--------------------------------------------------------------------
  2177. BadInstallINI:
  2178.  
  2179.     GetProfString( szMessages, "Messages", "BAD_INSTALL_INI", szText);
  2180.     MessageBox ( szText, SEVERE );
  2181.     goto ExitInstall;
  2182.  
  2183. //--------------------------------------------------------------------
  2184. //        This procedure will confirm with the users if they         -
  2185. //         want to terminate the installation of the course.         -
  2186. //--------------------------------------------------------------------
  2187. ConfirmCancel:
  2188.  
  2189.     GetProfString( szMessages, "Messages", "EXIT_ASK_MESG", szText);
  2190.     if (AskYesNo (szText, YES) = YES) then
  2191.         goto ExitInstall;           
  2192.     endif;
  2193.     return;
  2194.  
  2195. //--------------------------------------------------------------------
  2196. //  Installing Learner Management file for diskette install.
  2197. //--------------------------------------------------------------------
  2198.  
  2199.                        
  2200. //--------------------------------------------------------------------
  2201. //              This procedure will Put an exit message              -
  2202. //              to the screen and exit install program               -
  2203. //--------------------------------------------------------------------
  2204.  
  2205. ExitMessage:
  2206.  
  2207.     GetProfString( szMessages, "Messages", "EXIT_MESSAGE", szText);
  2208.     MessageBox( szText, INFORMATION );
  2209.     goto ExitInstall;
  2210. //
  2211.  
  2212. //---------------------------------------------------------------------
  2213. //                      Exit Install Program                          -
  2214. //---------------------------------------------------------------------
  2215.  
  2216. ExitInstall:
  2217.  
  2218. //  Clean up lists from memory
  2219.  
  2220.     VarRestore( SRCTARGETDIR );
  2221.     ListDestroy( listID1 );
  2222.     ListDestroy( listID2 );
  2223.     ListDestroy( wsDirList );
  2224.     ListDestroy(AgreementList);
  2225.     ListDestroy(ChangeDirList);
  2226.     UnUseDLL ("NEINSTL.DLL");
  2227.     WinHelp( nHwdInstall, szSourcedir ^ "instlhlp.hlp", HELP_QUIT, 0 ); 
  2228.     WinHelp( nHwdInstall, szSourcedir ^ "lic.hlp", HELP_QUIT, 0 );
  2229.  
  2230.     exit;
  2231.  
  2232. //-------------------- End of Install Program -------------------------
  2233.  
  2234. // Windows API Interface functions script file.
  2235. #include ".\\winsub.rul"
  2236.  
  2237.  
  2238.  
  2239. // ----------------------------------------------------------------------
  2240. //  Copyright ⌐ 1995, National Education Training Group, Inc.           -
  2241. //  All rights reserved.                                                -
  2242. //-----------------------------------------------------------------------
  2243.